<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Balanced ternary</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Balanced_ternary"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/ext.math.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Balanced_ternary rootpage-Balanced_ternary skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Balanced ternary</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1129693374">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hlist dl,.mw-parser-output .hlist ol,.mw-parser-output .hlist ul{margin:0;padding:0}.mw-parser-output .hlist dd,.mw-parser-output .hlist dt,.mw-parser-output .hlist li{margin:0;display:inline}.mw-parser-output .hlist.inline,.mw-parser-output .hlist.inline dl,.mw-parser-output .hlist.inline ol,.mw-parser-output .hlist.inline ul,.mw-parser-output .hlist dl dl,.mw-parser-output .hlist dl ol,.mw-parser-output .hlist dl ul,.mw-parser-output .hlist ol dl,.mw-parser-output .hlist ol ol,.mw-parser-output .hlist ol ul,.mw-parser-output .hlist ul dl,.mw-parser-output .hlist ul ol,.mw-parser-output .hlist ul ul{display:inline}.mw-parser-output .hlist .mw-empty-li{display:none}.mw-parser-output .hlist dt::after{content:": "}.mw-parser-output .hlist dd::after,.mw-parser-output .hlist li::after{content:" · ";font-weight:bold}.mw-parser-output .hlist dd:last-child::after,.mw-parser-output .hlist dt:last-child::after,.mw-parser-output .hlist li:last-child::after{content:none}.mw-parser-output .hlist dd dd:first-child::before,.mw-parser-output .hlist dd dt:first-child::before,.mw-parser-output .hlist dd li:first-child::before,.mw-parser-output .hlist dt dd:first-child::before,.mw-parser-output .hlist dt dt:first-child::before,.mw-parser-output .hlist dt li:first-child::before,.mw-parser-output .hlist li dd:first-child::before,.mw-parser-output .hlist li dt:first-child::before,.mw-parser-output .hlist li li:first-child::before{content:" (";font-weight:normal}.mw-parser-output .hlist dd dd:last-child::after,.mw-parser-output .hlist dd dt:last-child::after,.mw-parser-output .hlist dd li:last-child::after,.mw-parser-output .hlist dt dd:last-child::after,.mw-parser-output .hlist dt dt:last-child::after,.mw-parser-output .hlist dt li:last-child::after,.mw-parser-output .hlist li dd:last-child::after,.mw-parser-output .hlist li dt:last-child::after,.mw-parser-output .hlist li li:last-child::after{content:")";font-weight:normal}.mw-parser-output .hlist ol{counter-reset:listitem}.mw-parser-output .hlist ol>li{counter-increment:listitem}.mw-parser-output .hlist ol>li::before{content:" "counter(listitem)"\a0 "}.mw-parser-output .hlist dd ol>li:first-child::before,.mw-parser-output .hlist dt ol>li:first-child::before,.mw-parser-output .hlist li ol>li:first-child::before{content:" ("counter(listitem)"\a0 "}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1246091330">
/* start https://en.wikipedia.org/ */
.mw-parser-output .sidebar{width:22em;float:right;clear:right;margin:0.5em 0 1em 1em;background:var(--background-color-neutral-subtle,#f8f9fa);border:1px solid var(--border-color-base,#a2a9b1);padding:0.2em;text-align:center;line-height:1.4em;font-size:88%;border-collapse:collapse;display:table}body.skin-minerva .mw-parser-output .sidebar{display:table!important;float:right!important;margin:0.5em 0 1em 1em!important}.mw-parser-output .sidebar-subgroup{width:100%;margin:0;border-spacing:0}.mw-parser-output .sidebar-left{float:left;clear:left;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-none{float:none;clear:both;margin:0.5em 1em 1em 0}.mw-parser-output .sidebar-outer-title{padding:0 0.4em 0.2em;font-size:125%;line-height:1.2em;font-weight:bold}.mw-parser-output .sidebar-top-image{padding:0.4em}.mw-parser-output .sidebar-top-caption,.mw-parser-output .sidebar-pretitle-with-top-image,.mw-parser-output .sidebar-caption{padding:0.2em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-pretitle{padding:0.4em 0.4em 0;line-height:1.2em}.mw-parser-output .sidebar-title,.mw-parser-output .sidebar-title-with-pretitle{padding:0.2em 0.8em;font-size:145%;line-height:1.2em}.mw-parser-output .sidebar-title-with-pretitle{padding:0.1em 0.4em}.mw-parser-output .sidebar-image{padding:0.2em 0.4em 0.4em}.mw-parser-output .sidebar-heading{padding:0.1em 0.4em}.mw-parser-output .sidebar-content{padding:0 0.5em 0.4em}.mw-parser-output .sidebar-content-with-subgroup{padding:0.1em 0.4em 0.2em}.mw-parser-output .sidebar-above,.mw-parser-output .sidebar-below{padding:0.3em 0.8em;font-weight:bold}.mw-parser-output .sidebar-collapse .sidebar-above,.mw-parser-output .sidebar-collapse .sidebar-below{border-top:1px solid #aaa;border-bottom:1px solid #aaa}.mw-parser-output .sidebar-navbar{text-align:right;font-size:115%;padding:0 0.4em 0.4em}.mw-parser-output .sidebar-list-title{padding:0 0.4em;text-align:left;font-weight:bold;line-height:1.6em;font-size:105%}.mw-parser-output .sidebar-list-title-c{padding:0 0.4em;text-align:center;margin:0 3.3em}@media(max-width:640px){body.mediawiki .mw-parser-output .sidebar{width:100%!important;clear:both;float:none!important;margin-left:0!important;margin-right:0!important}}body.skin--responsive .mw-parser-output .sidebar a>img{max-width:none!important}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-night .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-list-title,html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle{background:transparent!important}html.skin-theme-clientpref-os .mw-parser-output .sidebar:not(.notheme) .sidebar-title-with-pretitle a{color:var(--color-progressive)!important}}@media print{body.ns-0 .mw-parser-output .sidebar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><table class="sidebar sidebar-collapse nomobile nowraplinks hlist"><tbody><tr><td class="sidebar-pretitle">Part of a series on</td></tr><tr><th class="sidebar-title-with-pretitle"><a href="Numeral_system" title="Numeral system">Numeral systems</a></th></tr><tr><td class="sidebar-content-with-subgroup">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c"><a href="Positional_notation" title="Positional notation">Place-value notation</a></div></div><div class="sidebar-list-content mw-collapsible-content"><table class="sidebar-subgroup"><tbody><tr><td class="sidebar-content hlist">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c"><a href="Hindu%E2%80%93Arabic_numeral_system" title="Hindu–Arabic numeral system">Hindu–Arabic numerals</a></div></div><div class="sidebar-list-content mw-collapsible-content">
<ul><li><a href="Arabic_numerals" title="Arabic numerals">Western Arabic</a></li>
<li><a href="Eastern_Arabic_numerals" title="Eastern Arabic numerals">Eastern Arabic</a></li></ul>
<hr>
<ul><li><a href="Bengali_numerals" title="Bengali numerals">Bengali</a></li>
<li><a href="Devanagari_numerals" title="Devanagari numerals">Devanagari</a></li>
<li><a href="Gujarati_numerals" title="Gujarati numerals">Gujarati</a></li>
<li><a href="Gurmukhi_numerals" class="mw-redirect" title="Gurmukhi numerals">Gurmukhi</a></li>
<li><a href="Odia_numerals" title="Odia numerals">Odia</a></li>
<li><a href="Sinhala_numerals" title="Sinhala numerals">Sinhala</a></li>
<li><a href="Tamil_numerals" title="Tamil numerals">Tamil</a></li>
<li><a href="Malayalam_numerals" title="Malayalam numerals">Malayalam</a></li>
<li><a href="Telugu_script#Numerals" title="Telugu script">Telugu</a></li>
<li><a href="Kannada_script#Numerals" title="Kannada script">Kannada</a></li>
<li><a href="Dzongkha_numerals" title="Dzongkha numerals">Dzongkha</a></li></ul>
<hr>
<ul><li><a href="Tibetan_numerals" title="Tibetan numerals">Tibetan</a></li>
<li><a href="Balinese_numerals" title="Balinese numerals">Balinese</a></li>
<li><a href="Burmese_numerals" title="Burmese numerals">Burmese</a></li>
<li><a href="Javanese_numerals" title="Javanese numerals">Javanese</a></li>
<li><a href="Khmer_numerals" title="Khmer numerals">Khmer</a></li>
<li><a href="Lao_script#Numerals" title="Lao script">Lao</a></li>
<li><a href="Mongolian_numerals" title="Mongolian numerals">Mongolian</a></li>
<li><a href="Sundanese_numerals" title="Sundanese numerals">Sundanese</a></li>
<li><a href="Thai_numerals" title="Thai numerals">Thai</a></li></ul></div></div></td>
</tr><tr><td class="sidebar-content hlist">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c">East Asian systems</div></div><div class="sidebar-list-content mw-collapsible-content">
<dl><dt>Contemporary</dt></dl>
<ul><li><a href="Chinese_numerals" title="Chinese numerals">Chinese</a>
<ul><li><a href="Hokkien_numerals" title="Hokkien numerals">Hokkien</a></li>
<li><a href="Suzhou_numerals" title="Suzhou numerals">Suzhou</a></li></ul></li>
<li><a href="Japanese_numerals" title="Japanese numerals">Japanese</a></li>
<li><a href="Korean_numerals" title="Korean numerals">Korean</a></li>
<li><a href="Vietnamese_numerals" title="Vietnamese numerals">Vietnamese</a></li></ul>
<hr>
<dl><dt>Historic</dt></dl>
<ul><li><a href="Counting_rods" title="Counting rods">Counting rods</a></li>
<li><a href="Tangut_numerals" title="Tangut numerals">Tangut</a></li></ul></div></div></td>
</tr><tr><td class="sidebar-content hlist">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c">Other systems</div></div><div class="sidebar-list-content mw-collapsible-content">
<ul><li><a href="History_of_ancient_numeral_systems" title="History of ancient numeral systems">History</a></li></ul>
<hr>
<dl><dt><a href="Ancient_history" title="Ancient history">Ancient</a></dt></dl>
<ul><li><a href="Babylonian_cuneiform_numerals" title="Babylonian cuneiform numerals">Babylonian</a></li></ul>
<hr>
<dl><dt><a href="Post-classical_history" title="Post-classical history">Post-classical</a></dt></dl>
<ul><li><a href="Cistercian_numerals" title="Cistercian numerals">Cistercian</a></li>
<li><a href="Maya_numerals" title="Maya numerals">Mayan</a></li>
<li><a href="Muisca_numerals" title="Muisca numerals">Muisca</a></li>
<li><a href="Pentadic_numerals" title="Pentadic numerals">Pentadic</a></li>
<li><a href="Quipu" title="Quipu">Quipu</a></li>
<li><a href="Rumi_Numeral_Symbols" title="Rumi Numeral Symbols">Rumi</a></li></ul>
<hr>
<dl><dt>Contemporary</dt></dl>
<ul><li><a href="Cherokee_syllabary#Numerals" title="Cherokee syllabary">Cherokee</a></li>
<li><a href="Kaktovik_numerals" title="Kaktovik numerals">Kaktovik</a> (Iñupiaq)</li></ul></div></div></td>
</tr><tr><td class="sidebar-content hlist">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c">By <a href="Radix" title="Radix">radix/base</a></div></div><div class="sidebar-list-content mw-collapsible-content">
<dl><dt>Common radices/bases</dt></dl>
<ul><li><a href="Binary_number" title="Binary number">2</a></li>
<li><a href="Ternary_numeral_system" title="Ternary numeral system">3</a></li>
<li><a href="Quaternary_numeral_system" title="Quaternary numeral system">4</a></li>
<li><a href="Quinary" title="Quinary">5</a></li>
<li><a href="Senary" title="Senary">6</a></li>
<li><a href="Octal" title="Octal">8</a></li>
<li><a href="Decimal" title="Decimal">10</a></li>
<li><a href="Duodecimal" title="Duodecimal">12</a></li>
<li><a href="Hexadecimal" title="Hexadecimal">16</a></li>
<li><a href="Vigesimal" title="Vigesimal">20</a></li>
<li><a href="Sexagesimal" title="Sexagesimal">60</a></li></ul>
<hr>
<dl><dt><a href="Non-standard_positional_numeral_systems" title="Non-standard positional numeral systems">Non-standard radices/bases</a></dt></dl>
<ul><li><a href="Bijective_numeration" title="Bijective numeration">Bijective</a><span class="nowrap"> </span>(<a href="Unary_numeral_system" title="Unary numeral system">1</a>)</li>
<li><a href="Signed-digit_representation" title="Signed-digit representation">Signed-digit</a><span class="nowrap"> </span>()</li>
<li><a href="Mixed_radix" title="Mixed radix">Mixed</a><span class="nowrap"> </span>(<a href="Factorial_number_system" title="Factorial number system">factorial</a>)</li>
<li><a href="Negative_base" title="Negative base">Negative</a></li>
<li><a href="Complex-base_system" title="Complex-base system">Complex</a><span class="nowrap"> </span>(<a href="Quater-imaginary_base" title="Quater-imaginary base">2<i>i</i></a>)</li>
<li><a href="Non-integer_base_of_numeration" title="Non-integer base of numeration">Non-integer</a><span class="nowrap"> </span>(<a href="Golden_ratio_base" title="Golden ratio base">φ</a>)</li>
<li><a href="Asymmetric_numeral_systems" title="Asymmetric numeral systems">Asymmetric</a></li></ul></div></div></td>
</tr></tbody></table></div></div></td>
</tr><tr><td class="sidebar-content">
<div class="sidebar-list mw-collapsible mw-collapsed"><div class="sidebar-list-title" style="color: var(--color-base)"><div class="sidebar-list-title-c"><a href="Sign-value_notation" title="Sign-value notation">Sign-value notation</a></div></div><div class="sidebar-list-content mw-collapsible-content">
<dl><dt>Non-alphabetic</dt></dl>
<ul><li><a href="Aegean_numerals" title="Aegean numerals">Aegean</a></li>
<li><a href="Attic_numerals" title="Attic numerals">Attic</a></li>
<li><a href="Aztec_script#Numerals" title="Aztec script">Aztec</a></li>
<li><a href="Brahmi_numerals" title="Brahmi numerals">Brahmi</a></li>
<li><a href="Chuvash_numerals" title="Chuvash numerals">Chuvash</a></li>
<li><a href="Egyptian_numerals" title="Egyptian numerals">Egyptian</a></li>
<li><a href="Etruscan_numerals" title="Etruscan numerals">Etruscan</a></li>
<li><a href="Kharosthi_numerals" class="mw-redirect" title="Kharosthi numerals">Kharosthi</a></li>
<li><a href="Prehistoric_counting" class="mw-redirect" title="Prehistoric counting">Prehistoric counting</a></li>
<li><a href="Proto-cuneiform" title="Proto-cuneiform">Proto-cuneiform</a></li>
<li><a href="Roman_numerals" title="Roman numerals">Roman</a></li>
<li><a href="Tally_marks" title="Tally marks">Tally marks</a></li></ul>
<hr>
<dl><dt><a href="Alphabetic_numeral_system" title="Alphabetic numeral system">Alphabetic</a></dt></dl>
<ul><li><a href="Abjad_numerals" title="Abjad numerals">Abjad</a></li>
<li><a href="Armenian_numerals" title="Armenian numerals">Armenian</a></li>
<li><a href="Alphasyllabic_numeral_system" title="Alphasyllabic numeral system">Alphasyllabic</a>
<ul><li><a href="Aksharapalli" title="Aksharapalli">Akṣarapallī</a></li>
<li><a href="%C4%80ryabha%E1%B9%ADa_numeration" title="Āryabhaṭa numeration">Āryabhaṭa</a></li>
<li><a href="Katapayadi_system" title="Katapayadi system">Kaṭapayādi</a></li></ul></li>
<li><a href="Coptic_numerals" class="mw-redirect" title="Coptic numerals">Coptic</a></li>
<li><a href="Cyrillic_numerals" title="Cyrillic numerals">Cyrillic</a></li>
<li><a href="Ge%CA%BDez_script#Numerals" title="Geʽez script">Geʽez</a></li>
<li><a href="Georgian_numerals" title="Georgian numerals">Georgian</a></li>
<li><a href="Glagolitic_numerals" title="Glagolitic numerals">Glagolitic</a></li>
<li><a href="Greek_numerals" title="Greek numerals">Greek</a></li>
<li><a href="Hebrew_numerals" title="Hebrew numerals">Hebrew</a></li></ul></div></div></td>
</tr><tr><td class="sidebar-below" style="border-top:1px solid #aaa;border-bottom:1px solid #aaa;">
<a href="List_of_numeral_systems" title="List of numeral systems">List of numeral systems</a></td></tr><tr><td class="sidebar-navbar"><style data-mw-deduplicate="TemplateStyles:r1239400231">
/* start https://en.wikipedia.org/ */
.mw-parser-output .navbar{display:inline;font-size:88%;font-weight:normal}.mw-parser-output .navbar-collapse{float:left;text-align:left}.mw-parser-output .navbar-boxtext{word-spacing:0}.mw-parser-output .navbar ul{display:inline-block;white-space:nowrap;line-height:inherit}.mw-parser-output .navbar-brackets::before{margin-right:-0.125em;content:"[ "}.mw-parser-output .navbar-brackets::after{margin-left:-0.125em;content:" ]"}.mw-parser-output .navbar li{word-spacing:-0.125em}.mw-parser-output .navbar a>span,.mw-parser-output .navbar a>abbr{text-decoration:inherit}.mw-parser-output .navbar-mini abbr{font-variant:small-caps;border-bottom:none;text-decoration:none;cursor:inherit}.mw-parser-output .navbar-ct-full{font-size:114%;margin:0 7em}.mw-parser-output .navbar-ct-mini{font-size:114%;margin:0 4em}html.skin-theme-clientpref-night .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}@media(prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .navbar li a abbr{color:var(--color-base)!important}}@media print{.mw-parser-output .navbar{display:none!important}}
/* end https://en.wikipedia.org/ */
</style></td></tr></tbody></table>
<p><b>Balanced ternary</b> is a <a href="Ternary_numeral_system" title="Ternary numeral system">ternary numeral system</a> (i.e. base 3 with three <a href="Numerical_digit" title="Numerical digit">digits</a>) that uses a balanced <a href="Signed-digit_representation" title="Signed-digit representation">signed-digit representation</a> of the <a href="Integer" title="Integer">integers</a> in which the digits have the values <a href="%E2%88%921" title="−1">−1</a>, <a href="0" title="0">0</a>, and <a href="1" title="1">1</a>. This stands in contrast to the standard (unbalanced) ternary system, in which digits have values 0, 1 and 2.
The balanced ternary system can represent all integers without using a separate <a href="Minus_sign" class="mw-redirect" title="Minus sign">minus sign</a>; the value of the leading non-zero digit of a number has the sign of the number itself. The balanced ternary system is an example of a <a href="Non-standard_positional_numeral_systems" title="Non-standard positional numeral systems">non-standard positional numeral system</a>. It was used in some early computers<sup id="cite_ref-setun_1-0" class="reference"><a href="#cite_note-setun-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> and has also been used to solve <a href="Balance_puzzle" title="Balance puzzle">balance puzzles</a>.<sup id="cite_ref-hayes_2-0" class="reference"><a href="#cite_note-hayes-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>Different sources use different glyphs to represent the three digits in balanced ternary. In this article, T (which resembles a <a href="Typographical_ligature" class="mw-redirect" title="Typographical ligature">ligature</a> of the minus sign and 1) represents <a href="%E2%88%921" title="−1">−1</a>, while <a href="0" title="0">0</a> and <a href="1" title="1">1</a> represent themselves. Other conventions include using '−' and '+' to represent −1 and 1 respectively, or using <a href="Greek_alphabet" title="Greek alphabet">Greek letter</a> <a href="Theta" title="Theta">theta</a> (Θ), which resembles a minus sign in a circle, to represent −1. In publications about the <a href="Setun" title="Setun">Setun</a> computer, −1 is represented as overturned 1: "<span style="display:inline-block;vertical-align:-0.05em;transform:matrix(-1, 0, 0, -1, 0, 0);">1</span>".<sup id="cite_ref-setun_1-1" class="reference"><a href="#cite_note-setun-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p><p>Balanced ternary makes an early appearance in <a href="Michael_Stifel" title="Michael Stifel">Michael Stifel</a>'s book <i>Arithmetica Integra</i> (1544).<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup> It also occurs in the works of <a href="Johannes_Kepler" title="Johannes Kepler">Johannes Kepler</a> and <a href="L%C3%A9on_Lalanne" title="Léon Lalanne">Léon Lalanne</a>. Related signed-digit schemes in other bases have been discussed by <a href="John_Colson" title="John Colson">John Colson</a>, <a href="John_Leslie_(physicist)" title="John Leslie (physicist)">John Leslie</a>, <a href="Augustin-Louis_Cauchy" title="Augustin-Louis Cauchy">Augustin-Louis Cauchy</a>, and possibly even the ancient Indian <a href="Vedas" title="Vedas">Vedas</a>.<sup id="cite_ref-hayes_2-1" class="reference"><a href="#cite_note-hayes-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Definition">Definition</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */
.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}
/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">See also: <a href="Signed-digit_representation" title="Signed-digit representation">Signed-digit representation</a></div>
<p>Let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}:=\lbrace \operatorname {T} ,0,1\rbrace }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo>:=</mo>
<mo fence="false" stretchy="false">{</mo>
<mi mathvariant="normal">T</mi>
<mo>,</mo>
<mn>0</mn>
<mo>,</mo>
<mn>1</mn>
<mo fence="false" stretchy="false">}</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}:=\lbrace \operatorname {T} ,0,1\rbrace }</annotation>
</semantics>
</math></span><img src="./50768e0c94862cfbf8a4702debd777b6b257a4cf.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.987ex; height:2.843ex;" alt="{\displaystyle {\mathcal {D}}_{3}:=\lbrace \operatorname {T} ,0,1\rbrace }" loading="lazy"></span> denote the set of <a href="Symbol_(mathematics)" class="mw-redirect" title="Symbol (mathematics)">symbols</a> (also called <i>glyphs</i> or <i>characters</i>), where the symbol <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\bar {1}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mn>1</mn>
<mo stretchy="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\bar {1}}}</annotation>
</semantics>
</math></span><img src="./33787267e125dbadb71bf531837ecb9858be9838.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.509ex;" alt="{\displaystyle {\bar {1}}}" loading="lazy"></span> is sometimes used in place of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \operatorname {T} .}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi mathvariant="normal">T</mi>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \operatorname {T} .}</annotation>
</semantics>
</math></span><img src="./9d8c4291d8f11ea7c60fe7eff0f4b18c621314a9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:2.325ex; height:2.176ex;" alt="{\displaystyle \operatorname {T} .}" loading="lazy"></span>
Define an <a href="Integer" title="Integer">integer</a>-valued function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f=f_{{\mathcal {D}}_{3}}:{\mathcal {D}}_{3}\to \mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
<mo>=</mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
</mrow>
</msub>
<mo>:</mo>
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo stretchy="false">→<!-- → --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f=f_{{\mathcal {D}}_{3}}:{\mathcal {D}}_{3}\to \mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./ad167ebb812484eb938450e8f58be1f8ef67ed8f.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:17.795ex; height:2.843ex;" alt="{\displaystyle f=f_{{\mathcal {D}}_{3}}:{\mathcal {D}}_{3}\to \mathbb {Z} }" loading="lazy"></span> by
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{aligned}f_{}(\operatorname {T} )&=-1,\\f_{}(0)&=0,\\f_{}(1)&=1,\end{aligned}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" displaystyle="true">
<mtr>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant="normal">T</mi>
<mo stretchy="false">)</mo>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo>,</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>0</mn>
<mo>,</mo>
</mtd>
</mtr>
<mtr>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>1</mn>
<mo>,</mo>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{aligned}f_{}(\operatorname {T} )&=-1,\\f_{}(0)&=0,\\f_{}(1)&=1,\end{aligned}}}</annotation>
</semantics>
</math></span><img src="./85dfad073ee59b9bf0dd5f40490deb3bfe70bb2e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -4.005ex; width:12.233ex; height:9.176ex;" alt="{\displaystyle {\begin{aligned}f_{}(\operatorname {T} )&=-1,\\f_{}(0)&=0,\\f_{}(1)&=1,\end{aligned}}}" loading="lazy"></span><sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup></dd></dl>
<p>where the right hand sides are integers with their usual values. This function, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f_{},}</annotation>
</semantics>
</math></span><img src="./cf9664765be195d689b4164b887ca210c62d856b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.925ex; height:2.509ex;" alt="{\displaystyle f_{},}" loading="lazy"></span> is what rigorously and formally establishes how integer values are assigned to the symbols/glyphs in <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}.}</annotation>
</semantics>
</math></span><img src="./c601269213d6d205741f5fd436099d3f8171169c.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:3.493ex; height:2.509ex;" alt="{\displaystyle {\mathcal {D}}_{3}.}" loading="lazy"></span> One benefit of this formalism is that the definition of "the integers" (however they may be defined) is not conflated with any particular system for writing/representing them; in this way, these two distinct (albeit closely related) concepts are kept separate.
</p><p>The set <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}}</annotation>
</semantics>
</math></span><img src="./ed525b93bf294538e4252b31cc93182d3444609b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.846ex; height:2.509ex;" alt="{\displaystyle {\mathcal {D}}_{3}}" loading="lazy"></span> together with the function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f_{}}</annotation>
</semantics>
</math></span><img src="./27d9bb421086ca85e928410a414136d78f1df850.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f_{}}" loading="lazy"></span> forms a balanced <a href="Signed-digit_representation" title="Signed-digit representation">signed-digit representation</a> called the <i>balanced ternary</i> system.
It can be used to represent integers and real numbers.
</p>
<div class="mw-heading mw-heading3"><h3 id="Ternary_integer_evaluation">Ternary integer evaluation</h3></div>
<p>Let <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}^{+}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}^{+}}</annotation>
</semantics>
</math></span><img src="./8a699f577a3031dcb819ac6cdfb23bad3d2d2153.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:3.303ex; height:3.176ex;" alt="{\displaystyle {\mathcal {D}}_{3}^{+}}" loading="lazy"></span> be the <a href="Kleene_plus" class="mw-redirect" title="Kleene plus">Kleene plus</a> of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}}</annotation>
</semantics>
</math></span><img src="./ed525b93bf294538e4252b31cc93182d3444609b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.846ex; height:2.509ex;" alt="{\displaystyle {\mathcal {D}}_{3}}" loading="lazy"></span>, which is the set of all finite length <a href="Concatenation" title="Concatenation">concatenated</a> <a href="String_(computer_science)" title="String (computer science)">strings</a> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}}</annotation>
</semantics>
</math></span><img src="./c7fd6676c95e1327e06a57e8a02330e386e44fea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.188ex; height:2.509ex;" alt="{\displaystyle d_{n}\ldots d_{0}}" loading="lazy"></span> of one or more symbols (called its <i>digits</i>) where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>n</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n}</annotation>
</semantics>
</math></span><img src="./a601995d55609f2d9f5e233e36fbe9ea26011b3b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.395ex; height:1.676ex;" alt="{\displaystyle n}" loading="lazy"></span> is a non-negative integer and all <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n+1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>n</mi>
<mo>+</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n+1}</annotation>
</semantics>
</math></span><img src="./2a135e65a42f2d73cccbfc4569523996ca0036f1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.398ex; height:2.343ex;" alt="{\displaystyle n+1}" loading="lazy"></span> digits <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n},\ldots ,d_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>,</mo>
<mo>…<!-- … --></mo>
<mo>,</mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n},\ldots ,d_{0}}</annotation>
</semantics>
</math></span><img src="./135fd9f425e91a1acd53b8e01bcc5f1ca4867561.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:9.869ex; height:2.509ex;" alt="{\displaystyle d_{n},\ldots ,d_{0}}" loading="lazy"></span> are taken from <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}=\lbrace \operatorname {T} ,0,1\rbrace .}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo>=</mo>
<mo fence="false" stretchy="false">{</mo>
<mi mathvariant="normal">T</mi>
<mo>,</mo>
<mn>0</mn>
<mo>,</mo>
<mn>1</mn>
<mo fence="false" stretchy="false">}</mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}=\lbrace \operatorname {T} ,0,1\rbrace .}</annotation>
</semantics>
</math></span><img src="./246f45ddd8fd84a389672acd8b41a59f6559f21a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:14.987ex; height:2.843ex;" alt="{\displaystyle {\mathcal {D}}_{3}=\lbrace \operatorname {T} ,0,1\rbrace .}" loading="lazy"></span> The <i>start</i> of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}}</annotation>
</semantics>
</math></span><img src="./c7fd6676c95e1327e06a57e8a02330e386e44fea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.188ex; height:2.509ex;" alt="{\displaystyle d_{n}\ldots d_{0}}" loading="lazy"></span> is the symbol <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{0}}</annotation>
</semantics>
</math></span><img src="./4740381c16ea98c4132510daa642e93c1e42c049.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.263ex; height:2.509ex;" alt="{\displaystyle d_{0}}" loading="lazy"></span> (at the right), its <i>end</i> is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}}</annotation>
</semantics>
</math></span><img src="./858aa7b9662c90d0e01c9615aac9b1fdd84a02dd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.427ex; height:2.509ex;" alt="{\displaystyle d_{n}}" loading="lazy"></span> (at the left), and its <i>length</i> is <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n+1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>n</mi>
<mo>+</mo>
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n+1}</annotation>
</semantics>
</math></span><img src="./2a135e65a42f2d73cccbfc4569523996ca0036f1.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.505ex; width:5.398ex; height:2.343ex;" alt="{\displaystyle n+1}" loading="lazy"></span>. The <i>ternary evaluation</i> is the function <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v=v_{3}~:~{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mo>=</mo>
<msub>
<mi>v</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mtext> </mtext>
<mo>:</mo>
<mtext> </mtext>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
<mo stretchy="false">→<!-- → --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v=v_{3}~:~{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./fbb183b7e25dba742bb0322b60c8fd3b40c28620.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:17.973ex; height:3.176ex;" alt="{\displaystyle v=v_{3}~:~{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }" loading="lazy"></span> defined by assigning to every string <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>∈<!-- ∈ --></mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}</annotation>
</semantics>
</math></span><img src="./232a84cf75c219ec6c83978ad1965ecc75daee9a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:14.331ex; height:3.176ex;" alt="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}" loading="lazy"></span> the integer
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(d_{n}\ldots d_{0}\right)~=~\sum _{i=0}^{n}f_{}\left(d_{i}\right)3^{i}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
<mtext> </mtext>
<mo>=</mo>
<mtext> </mtext>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>i</mi>
</mrow>
</msup>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(d_{n}\ldots d_{0}\right)~=~\sum _{i=0}^{n}f_{}\left(d_{i}\right)3^{i}.}</annotation>
</semantics>
</math></span><img src="./49812183cb6a0c501c3550f4d28d6cc1f66571eb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:28.768ex; height:6.843ex;" alt="{\displaystyle v\left(d_{n}\ldots d_{0}\right)~=~\sum _{i=0}^{n}f_{}\left(d_{i}\right)3^{i}.}" loading="lazy"></span></dd></dl>
<p>The string <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}}</annotation>
</semantics>
</math></span><img src="./c7fd6676c95e1327e06a57e8a02330e386e44fea.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:8.188ex; height:2.509ex;" alt="{\displaystyle d_{n}\ldots d_{0}}" loading="lazy"></span> <i>represents</i> (with respect to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v}</annotation>
</semantics>
</math></span><img src="./e07b00e7fc0847fbd16391c778d65bc25c452597.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.128ex; height:1.676ex;" alt="{\displaystyle v}" loading="lazy"></span>) the integer <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(d_{n}\ldots d_{0}\right).}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(d_{n}\ldots d_{0}\right).}</annotation>
</semantics>
</math></span><img src="./6438c7e57ebe477b4f64cc71b651c22a5979965d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.546ex; height:2.843ex;" alt="{\displaystyle v\left(d_{n}\ldots d_{0}\right).}" loading="lazy"></span> The value <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(d_{n}\ldots d_{0}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(d_{n}\ldots d_{0}\right)}</annotation>
</semantics>
</math></span><img src="./a168ea9bd5f706d3c64dd21d782fb5ab9326eb23.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:11.512ex; height:2.843ex;" alt="{\displaystyle v\left(d_{n}\ldots d_{0}\right)}" loading="lazy"></span> may alternatively be denoted by <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {d_{n}\ldots d_{0}}_{\operatorname {bal} 3}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>bal</mi>
<mo><!-- --></mo>
<mn>3</mn>
</mrow>
</msub>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {d_{n}\ldots d_{0}}_{\operatorname {bal} 3}.}</annotation>
</semantics>
</math></span><img src="./24cf66cf7e005435ee760c81e505303667ac06e8.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.469ex; height:2.676ex;" alt="{\displaystyle {d_{n}\ldots d_{0}}_{\operatorname {bal} 3}.}" loading="lazy"></span>
The map <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v:{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mo>:</mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
<mo stretchy="false">→<!-- → --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v:{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }</annotation>
</semantics>
</math></span><img src="./755a524c9b7870b636ce6218241e64e330f25eb9.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:11.532ex; height:3.176ex;" alt="{\displaystyle v:{\mathcal {D}}_{3}^{+}\to \mathbb {Z} }" loading="lazy"></span> is <a href="Surjective_map" class="mw-redirect" title="Surjective map">surjective</a> but not injective since, for example, <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0=v(0)=v(00)=v(000)=\cdots .}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
<mo>=</mo>
<mi>v</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>v</mi>
<mo stretchy="false">(</mo>
<mn>00</mn>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mi>v</mi>
<mo stretchy="false">(</mo>
<mn>000</mn>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mo>⋯<!-- ⋯ --></mo>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0=v(0)=v(00)=v(000)=\cdots .}</annotation>
</semantics>
</math></span><img src="./0da75b0801b7246d094703095864bedd9960a365.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:33.099ex; height:2.843ex;" alt="{\displaystyle 0=v(0)=v(00)=v(000)=\cdots .}" loading="lazy"></span> However, every nonzero integer has exactly one representation under <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v}</annotation>
</semantics>
</math></span><img src="./e07b00e7fc0847fbd16391c778d65bc25c452597.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.128ex; height:1.676ex;" alt="{\displaystyle v}" loading="lazy"></span> that does not <i>end</i> (on the left) with the symbol <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0,}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0,}</annotation>
</semantics>
</math></span><img src="./95547343453ea34a314dd174f8458012f5a39ca3.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.809ex; height:2.509ex;" alt="{\displaystyle 0,}" loading="lazy"></span> i.e. <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}=0.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>=</mo>
<mn>0.</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}=0.}</annotation>
</semantics>
</math></span><img src="./bd03b8f73837901fa3cc54462599e8f7762e982e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:7.335ex; height:2.509ex;" alt="{\displaystyle d_{n}=0.}" loading="lazy"></span>
</p><p>If <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>∈<!-- ∈ --></mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}</annotation>
</semantics>
</math></span><img src="./232a84cf75c219ec6c83978ad1965ecc75daee9a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:14.331ex; height:3.176ex;" alt="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+}}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle n>0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>n</mi>
<mo>></mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle n>0}</annotation>
</semantics>
</math></span><img src="./27a6a5d982d54202a14f111cb8a49210501b2c96.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:5.656ex; height:2.176ex;" alt="{\displaystyle n>0}" loading="lazy"></span> then <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v}</annotation>
</semantics>
</math></span><img src="./e07b00e7fc0847fbd16391c778d65bc25c452597.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.128ex; height:1.676ex;" alt="{\displaystyle v}" loading="lazy"></span> satisfies:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(d_{n}d_{n-1}\ldots d_{0}\right)~=~f_{}\left(d_{n}\right)3^{n}+v\left(d_{n-1}\ldots d_{0}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
<mtext> </mtext>
<mo>=</mo>
<mtext> </mtext>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msup>
<mo>+</mo>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(d_{n}d_{n-1}\ldots d_{0}\right)~=~f_{}\left(d_{n}\right)3^{n}+v\left(d_{n-1}\ldots d_{0}\right)}</annotation>
</semantics>
</math></span><img src="./6ab06a84f4ffab2e2aae24e33af99ded16ceb591.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:45.81ex; height:2.843ex;" alt="{\displaystyle v\left(d_{n}d_{n-1}\ldots d_{0}\right)~=~f_{}\left(d_{n}\right)3^{n}+v\left(d_{n-1}\ldots d_{0}\right)}" loading="lazy"></span></dd></dl>
<p>which shows that <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v}</annotation>
</semantics>
</math></span><img src="./e07b00e7fc0847fbd16391c778d65bc25c452597.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.128ex; height:1.676ex;" alt="{\displaystyle v}" loading="lazy"></span> satisfies a sort of <a href="Recurrence_relation" title="Recurrence relation">recurrence relation</a>. This recurrence relation has the initial condition
<span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(\varepsilon \right)=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mi>ε<!-- ε --></mi>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(\varepsilon \right)=0}</annotation>
</semantics>
</math></span><img src="./6a277b7e14bec0b34bf874dbac11e55c9752a9c5.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.668ex; height:2.843ex;" alt="{\displaystyle v\left(\varepsilon \right)=0}" loading="lazy"></span>
where <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \varepsilon }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>ε<!-- ε --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \varepsilon }</annotation>
</semantics>
</math></span><img src="./a30c89172e5b88edbd45d3e2772c7f5e562e5173.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.083ex; height:1.676ex;" alt="{\displaystyle \varepsilon }" loading="lazy"></span> is the empty string.
</p><p>This implies that for every string <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+},}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>∈<!-- ∈ --></mo>
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+},}</annotation>
</semantics>
</math></span><img src="./eb7fee18eae739f65f76b39663396fe4fadfb9eb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:14.978ex; height:3.176ex;" alt="{\displaystyle d_{n}\ldots d_{0}\in {\mathcal {D}}_{3}^{+},}" loading="lazy"></span>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(0d_{n}\ldots d_{0}\right)=v\left(d_{n}\ldots d_{0}\right)}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>0</mn>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<mo>…<!-- … --></mo>
<msub>
<mi>d</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
</mrow>
<mo>)</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(0d_{n}\ldots d_{0}\right)=v\left(d_{n}\ldots d_{0}\right)}</annotation>
</semantics>
</math></span><img src="./29ff031187ede3e6e697ce7c90d3f6209f89c969.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:27.285ex; height:2.843ex;" alt="{\displaystyle v\left(0d_{n}\ldots d_{0}\right)=v\left(d_{n}\ldots d_{0}\right)}" loading="lazy"></span></dd></dl>
<p>which in words says that <i>leading</i> <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0}</annotation>
</semantics>
</math></span><img src="./2aae8864a3c1fec9585261791a809ddec1489950.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.176ex;" alt="{\displaystyle 0}" loading="lazy"></span> symbols (to the left in a string with 2 or more symbols) do not affect the resulting value.
</p><p>The following examples illustrate how some values of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v}</annotation>
</semantics>
</math></span><img src="./e07b00e7fc0847fbd16391c778d65bc25c452597.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.128ex; height:1.676ex;" alt="{\displaystyle v}" loading="lazy"></span> can be computed, where (as before) all integer are written in decimal (base 10) and all elements of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}^{+}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msubsup>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mo>+</mo>
</mrow>
</msubsup>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}^{+}}</annotation>
</semantics>
</math></span><img src="./8a699f577a3031dcb819ac6cdfb23bad3d2d2153.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.005ex; width:3.303ex; height:3.176ex;" alt="{\displaystyle {\mathcal {D}}_{3}^{+}}" loading="lazy"></span> are just symbols.
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\begin{alignedat}{10}v\left(\operatorname {T} \operatorname {T} \right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(-1)&&3&&\,+\,&&(-1)&&1&&=-4\\v\left(\operatorname {T} 1\right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(-1)&&3&&\,+\,&&(1)&&1&&=-2\\v\left(1\operatorname {T} \right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(1)&&3&&\,+\,&&(-1)&&1&&=2\\v\left(11\right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(1)&&3&&\,+\,&&(1)&&1&&=4\\v\left(1\operatorname {T} 0\right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(0\right)3^{0}&&=(1)9\,+\,&&(-1)&&3&&\,+\,&&(0)&&1&&=6\\v\left(10\operatorname {T} \right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(0\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=(1)9\,+\,&&(0)&&3&&\,+\,&&(-1)&&1&&=8\\\end{alignedat}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<mtable columnalign="right left right left right left right left right left right left right left right left right left right left" rowspacing="3pt" columnspacing="0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em 0em" displaystyle="true">
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mi mathvariant="normal">T</mi>
<mo><!-- --></mo>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mn>4</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mi mathvariant="normal">T</mi>
<mo><!-- --></mo>
<mn>1</mn>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mn>2</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>2</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mn>11</mn>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>4</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mo><!-- --></mo>
<mn>0</mn>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>0</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mn>9</mn>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>6</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>10</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
</mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>0</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msup>
<mo>+</mo>
</mtd>
<mtd></mtd>
<mtd>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mi mathvariant="normal">T</mi>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msup>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mn>9</mn>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>3</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mspace width="thinmathspace"></mspace>
<mo>+</mo>
<mspace width="thinmathspace"></mspace>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo stretchy="false">(</mo>
<mo>−<!-- − --></mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
</mtd>
<mtd></mtd>
<mtd>
<mn>1</mn>
</mtd>
<mtd></mtd>
<mtd>
<mi></mi>
<mo>=</mo>
<mn>8</mn>
</mtd>
</mtr>
</mtable>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\begin{alignedat}{10}v\left(\operatorname {T} \operatorname {T} \right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(-1)&&3&&\,+\,&&(-1)&&1&&=-4\\v\left(\operatorname {T} 1\right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(-1)&&3&&\,+\,&&(1)&&1&&=-2\\v\left(1\operatorname {T} \right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(1)&&3&&\,+\,&&(-1)&&1&&=2\\v\left(11\right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(1)&&3&&\,+\,&&(1)&&1&&=4\\v\left(1\operatorname {T} 0\right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(0\right)3^{0}&&=(1)9\,+\,&&(-1)&&3&&\,+\,&&(0)&&1&&=6\\v\left(10\operatorname {T} \right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(0\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=(1)9\,+\,&&(0)&&3&&\,+\,&&(-1)&&1&&=8\\\end{alignedat}}}</annotation>
</semantics>
</math></span><img src="./14ba4b982fdea5a325077a5a2cf9f0b75e0dcceb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -9.073ex; margin-bottom: -0.265ex; width:69.706ex; height:19.843ex;" alt="{\displaystyle {\begin{alignedat}{10}v\left(\operatorname {T} \operatorname {T} \right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(-1)&&3&&\,+\,&&(-1)&&1&&=-4\\v\left(\operatorname {T} 1\right)&=&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(-1)&&3&&\,+\,&&(1)&&1&&=-2\\v\left(1\operatorname {T} \right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=&&(1)&&3&&\,+\,&&(-1)&&1&&=2\\v\left(11\right)&=&&f_{}\left(1\right)3^{1}+&&f_{}\left(1\right)3^{0}&&=&&(1)&&3&&\,+\,&&(1)&&1&&=4\\v\left(1\operatorname {T} 0\right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(\operatorname {T} \right)3^{1}+&&f_{}\left(0\right)3^{0}&&=(1)9\,+\,&&(-1)&&3&&\,+\,&&(0)&&1&&=6\\v\left(10\operatorname {T} \right)&=f_{}\left(1\right)3^{2}+&&f_{}\left(0\right)3^{1}+&&f_{}\left(\operatorname {T} \right)3^{0}&&=(1)9\,+\,&&(0)&&3&&\,+\,&&(-1)&&1&&=8\\\end{alignedat}}}" loading="lazy"></span></dd></dl>
<p>and using the above recurrence relation
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle v\left(101\operatorname {T} \right)=f_{}\left(1\right)3^{3}+v\left(01\operatorname {T} \right)=(1)27+v\left(1\operatorname {T} \right)=27+2=29.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>101</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
<mo>=</mo>
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mrow>
<mo>(</mo>
<mn>1</mn>
<mo>)</mo>
</mrow>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msup>
<mo>+</mo>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>01</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mn>27</mn>
<mo>+</mo>
<mi>v</mi>
<mrow>
<mo>(</mo>
<mrow>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>)</mo>
</mrow>
<mo>=</mo>
<mn>27</mn>
<mo>+</mo>
<mn>2</mn>
<mo>=</mo>
<mn>29.</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle v\left(101\operatorname {T} \right)=f_{}\left(1\right)3^{3}+v\left(01\operatorname {T} \right)=(1)27+v\left(1\operatorname {T} \right)=27+2=29.}</annotation>
</semantics>
</math></span><img src="./a4404186d05bb49bc943bf6e1250f853f8c7ca65.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:63.054ex; height:3.176ex;" alt="{\displaystyle v\left(101\operatorname {T} \right)=f_{}\left(1\right)3^{3}+v\left(01\operatorname {T} \right)=(1)27+v\left(1\operatorname {T} \right)=27+2=29.}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading2"><h2 id="Conversions_to/from_other_representations">Conversions to/from other representations</h2></div>
<div class="mw-heading mw-heading3"><h3 id="Conversion_to_decimal">Conversion to decimal</h3></div>
<p>In the balanced ternary system the value of a digit <i>n</i> places left of the <a href="Radix_point" class="mw-redirect" title="Radix point">radix point</a> is the product of the digit and 3<sup><i>n</i></sup>. This is useful when converting between decimal and balanced ternary. In the following the strings denoting balanced ternary carry the suffix, <i>bal3</i>. For instance,
</p>
<dl><dd>10<sub>bal3</sub> = 1 × 3<sup>1</sup> + 0 × 3<sup>0</sup> = 3<sub>dec</sub></dd>
<dd>10𝖳<sub>bal3</sub> = 1 × 3<sup>2</sup> + 0 × 3<sup>1</sup> + (−1) × 3<sup>0</sup> = 8<sub>dec</sub></dd>
<dd>−9<sub>dec</sub> = −1 × 3<sup>2</sup> + 0 × 3<sup>1</sup> + 0 × 3<sup>0</sup> = 𝖳00<sub>bal3</sub></dd>
<dd>8<sub>dec</sub> = 1 × 3<sup>2</sup> + 0 × 3<sup>1</sup> + (−1) × 3<sup>0</sup> = 10𝖳<sub>bal3</sub></dd></dl>
<p>Similarly, the first place to the right of the radix point holds 3<sup>−1</sup> = <style data-mw-deduplicate="TemplateStyles:r1214402035">
/* start https://en.wikipedia.org/ */
.mw-parser-output .sfrac{white-space:nowrap}.mw-parser-output .sfrac.tion,.mw-parser-output .sfrac .tion{display:inline-block;vertical-align:-0.5em;font-size:85%;text-align:center}.mw-parser-output .sfrac .num{display:block;line-height:1em;margin:0.0em 0.1em;border-bottom:1px solid}.mw-parser-output .sfrac .den{display:block;line-height:1em;margin:0.1em 0.1em}.mw-parser-output .sr-only{border:0;clip:rect(0,0,0,0);clip-path:polygon(0px 0px,0px 0px,0px 0px);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}
/* end https://en.wikipedia.org/ */
</style><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">3</span></span></span>, the second place holds 3<sup>−2</sup> = <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">9</span></span></span>, and so on. For instance,
</p>
<dl><dd>−<span class="sfrac"><span class="tion"><span class="num">2</span><span class="sr-only">/</span><span class="den">3</span></span></span><sub>dec</sub> = −1 + <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">3</span></span></span> = −1 × 3<sup>0</sup> + 1 × 3<sup>−1</sup> = 𝖳.1<sub>bal3</sub>.</dd></dl>
<div style="display: flex; column-gap: 1em; margin-inline-start: 1.5em;">
<table class="wikitable" style="border: none; text-align:right">
<tbody><tr>
<th>Dec</th>
<th>Bal3</th>
<th>Expansion
</th></tr>
<tr>
<td>0</td>
<td>0</td>
<td>0
</td></tr>
<tr>
<td>1</td>
<td>1</td>
<td>+1
</td></tr>
<tr>
<td>2</td>
<td>1𝖳</td>
<td>+3−1
</td></tr>
<tr>
<td>3</td>
<td>10</td>
<td>+3
</td></tr>
<tr>
<td>4</td>
<td>11</td>
<td>+3+1
</td></tr>
<tr>
<td>5</td>
<td>1𝖳𝖳</td>
<td>+9−3−1
</td></tr>
<tr>
<td>6</td>
<td>1𝖳0</td>
<td>+9−3
</td></tr>
<tr>
<td>7</td>
<td>1𝖳1</td>
<td>+9−3+1
</td></tr>
<tr>
<td>8</td>
<td>10𝖳</td>
<td>+9−1
</td></tr>
<tr>
<td>9</td>
<td>100</td>
<td>+9
</td></tr>
<tr>
<td>10</td>
<td>101</td>
<td>+9+1
</td></tr>
<tr>
<td>11</td>
<td>11𝖳</td>
<td>+9+3−1
</td></tr>
<tr>
<td>12</td>
<td>110</td>
<td>+9+3
</td></tr>
<tr>
<td>13</td>
<td>111</td>
<td>+9+3+1
</td></tr></tbody></table>
<table class="wikitable" style="border: none; text-align:right">
<tbody><tr>
<th>Dec</th>
<th>Bal3</th>
<th>Expansion
</th></tr>
<tr>
<td>0</td>
<td>0</td>
<td>0
</td></tr>
<tr>
<td>−1</td>
<td>𝖳</td>
<td>−1
</td></tr>
<tr>
<td>−2</td>
<td>𝖳1</td>
<td>−3+1
</td></tr>
<tr>
<td>−3</td>
<td>𝖳0</td>
<td>−3
</td></tr>
<tr>
<td>−4</td>
<td>𝖳𝖳</td>
<td>−3−1
</td></tr>
<tr>
<td>−5</td>
<td>𝖳11</td>
<td>−9+3+1
</td></tr>
<tr>
<td>−6</td>
<td>𝖳10</td>
<td>−9+3
</td></tr>
<tr>
<td>−7</td>
<td>𝖳1𝖳</td>
<td>−9+3−1
</td></tr>
<tr>
<td>−8</td>
<td>𝖳01</td>
<td>−9+1
</td></tr>
<tr>
<td>−9</td>
<td>𝖳00</td>
<td>−9
</td></tr>
<tr>
<td>−10</td>
<td>𝖳0𝖳</td>
<td>−9−1
</td></tr>
<tr>
<td>−11</td>
<td>𝖳𝖳1</td>
<td>−9−3+1
</td></tr>
<tr>
<td>−12</td>
<td>𝖳𝖳0</td>
<td>−9−3
</td></tr>
<tr>
<td>−13</td>
<td>𝖳𝖳𝖳</td>
<td>−9−3−1
</td></tr></tbody></table>
</div>
<p>An integer is divisible by three if and only if the digit in the units place is zero.
</p><p>We may check the <a href="Parity_(mathematics)" title="Parity (mathematics)">parity</a> of a balanced ternary integer by checking the parity of the sum of all trits. This sum has the same parity as the integer itself.
</p><p>Balanced ternary can also be extended to fractional numbers similar to how decimal numbers are written to the right of the <a href="Radix_point" class="mw-redirect" title="Radix point">radix point</a>.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><table class="wikitable">
<tbody><tr>
<th>Decimal
</th>
<th style="text-align: right">−0.9
</th>
<th style="text-align: right">−0.8
</th>
<th style="text-align: right">−0.7
</th>
<th style="text-align: right">−0.6
</th>
<th style="text-align: right">−0.5
</th>
<th style="text-align: right">−0.4
</th>
<th style="text-align: right">−0.3
</th>
<th style="text-align: right">−0.2
</th>
<th style="text-align: right">−0.1
</th>
<th style="text-align: right">0
</th></tr>
<tr>
<th>Balanced Ternary
</th>
<td>𝖳.<span style="text-decoration:overline;">010𝖳</span></td>
<td>𝖳.<span style="text-decoration:overline;">1𝖳𝖳1</span></td>
<td>𝖳.<span style="text-decoration:overline;">10𝖳0</span></td>
<td>𝖳.<span style="text-decoration:overline;">11𝖳𝖳</span></td>
<td>0.<span style="text-decoration:overline;">𝖳</span> or 𝖳.<span style="text-decoration:overline;">1</span></td>
<td>0.<span style="text-decoration:overline;">𝖳𝖳11</span></td>
<td>0.<span style="text-decoration:overline;">𝖳010</span></td>
<td>0.<span style="text-decoration:overline;">𝖳11𝖳</span></td>
<td>0.<span style="text-decoration:overline;">0𝖳01</span></td>
<td>0
</td></tr>
<tr>
<th>Decimal
</th>
<th style="text-align: right">0.9
</th>
<th style="text-align: right">0.8
</th>
<th style="text-align: right">0.7
</th>
<th style="text-align: right">0.6
</th>
<th style="text-align: right">0.5
</th>
<th style="text-align: right">0.4
</th>
<th style="text-align: right">0.3
</th>
<th style="text-align: right">0.2
</th>
<th style="text-align: right">0.1
</th>
<th style="text-align: right">0
</th></tr>
<tr>
<th>Balanced Ternary
</th>
<td>1.<span style="text-decoration:overline;">0𝖳01</span></td>
<td>1.<span style="text-decoration:overline;">𝖳11𝖳</span></td>
<td>1.<span style="text-decoration:overline;">𝖳010</span></td>
<td>1.<span style="text-decoration:overline;">𝖳𝖳11</span></td>
<td>0.<span style="text-decoration:overline;">1</span> or 1.<span style="text-decoration:overline;">𝖳</span></td>
<td>0.<span style="text-decoration:overline;">11𝖳𝖳</span></td>
<td>0.<span style="text-decoration:overline;">10𝖳0</span></td>
<td>0.<span style="text-decoration:overline;">1𝖳𝖳1</span></td>
<td>0.<span style="text-decoration:overline;">010𝖳</span></td>
<td>0
</td></tr></tbody></table></dd></dl>
<p>In decimal or binary, integer values and terminating fractions have multiple representations. For example, <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">10</span></span></span> = 0.1 = 0.1<span style="text-decoration:overline;">0</span> = 0.0<span style="text-decoration:overline;">9</span>. And, <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">2</span></span></span> = 0.1<sub>2</sub> = 0.1<span style="text-decoration:overline;">0</span><sub>2</sub> = 0.0<span style="text-decoration:overline;">1</span><sub>2</sub>. Some balanced ternary fractions have multiple representations too. For example, <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">6</span></span></span> = 0.1<span style="text-decoration:overline;">𝖳</span><sub>bal3</sub> = 0.0<span style="text-decoration:overline;">1</span><sub>bal3</sub>. Certainly, in the decimal and binary, we may omit the rightmost trailing infinite 0s after the radix point and gain a representations of integer or terminating fraction. But, in balanced ternary, we can't omit the rightmost trailing infinite −1s after the radix point in order to gain a representations of integer or terminating fraction.
</p><p><a href="Donald_Knuth" title="Donald Knuth">Donald Knuth</a><sup id="cite_ref-Knuth_6-0" class="reference"><a href="#cite_note-Knuth-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> has pointed out that truncation and rounding are the same operation in balanced ternary—they produce exactly the same result (a property shared with other balanced numeral systems). The number <span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">2</span></span></span> is not exceptional; it has two equally valid representations, and two equally valid truncations: 0.<span style="text-decoration:overline;">1</span> (round to 0, and truncate to 0) and 1.<span style="text-decoration:overline;">𝖳</span> (round to 1, and truncate to 1). With an odd <a href="Radix" title="Radix">radix</a>, <a href="Rounding#Double_rounding" title="Rounding">double rounding</a> is also equivalent to directly rounding to the final precision, unlike with an even radix.
</p><p>The basic operations—addition, subtraction, multiplication, and division—are done as in regular ternary. Multiplication by two can be done by adding a number to itself, or subtracting itself after a-trit-left-shifting.
</p><p>An arithmetic shift left of a balanced ternary number is the equivalent of multiplication by a (positive, integral) power of 3; and an arithmetic shift right of a balanced ternary number is the equivalent of division by a (positive, integral) power of 3.
</p>
<div class="mw-heading mw-heading3"><h3 id="Conversion_to_and_from_a_fraction">Conversion to and from a fraction</h3></div>
<div style="display: flex; column-gap: 1em; margin-inline-start: 1.5em;">
<table class="wikitable" style="text-align: center;">
<tbody><tr>
<th>Fraction</th>
<th colspan="2">Balanced ternary
</th></tr>
<tr>
<td>1</td>
<td colspan="2">1
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">2</span></span></span></td>
<td>0.<span style="text-decoration:overline;">1</span></td>
<td>1.<span style="text-decoration:overline;">𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">3</span></span></span></td>
<td colspan="2">0.1
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">4</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">1𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">5</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">1𝖳𝖳1</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">6</span></span></span></td>
<td>0.0<span style="text-decoration:overline;">1</span></td>
<td>0.1<span style="text-decoration:overline;">𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">7</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">0110𝖳𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">8</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">9</span></span></span></td>
<td colspan="2">0.01
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">10</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">010𝖳</span>
</td></tr></tbody></table>
<table class="wikitable" style="text-align: center;">
<tbody><tr>
<th>Fraction</th>
<th colspan="2">Balanced ternary
</th></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">11</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01𝖳11</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">12</span></span></span></td>
<td colspan="2">0.0<span style="text-decoration:overline;">1𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">13</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">14</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01𝖳0𝖳1</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">15</span></span></span></td>
<td colspan="2">0.0<span style="text-decoration:overline;">1𝖳𝖳1</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">16</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01𝖳𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">17</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">01𝖳𝖳𝖳10𝖳0𝖳111𝖳01</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">18</span></span></span></td>
<td>0.00<span style="text-decoration:overline;">1</span></td>
<td>0.01<span style="text-decoration:overline;">𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">19</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">00111𝖳10100𝖳𝖳𝖳1𝖳0𝖳</span>
</td></tr>
<tr>
<td><span class="sfrac"><span class="tion"><span class="num">1</span><span class="sr-only">/</span><span class="den">20</span></span></span></td>
<td colspan="2">0.<span style="text-decoration:overline;">0011</span>
</td></tr></tbody></table>
</div>
<p>The conversion of a repeating balanced ternary number to a fraction is analogous to <a href="Repeating_decimal#Converting_repeating_decimals_to_fractions" title="Repeating decimal">converting a repeating decimal</a>. For example (because of 111111<sub>bal3</sub> = (<span class="sfrac"><span class="tion"><span class="num">3<sup>6</sup> − 1</span><span class="sr-only">/</span><span class="den">3 − 1</span></span></span>)<sub>dec</sub>):
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0.1{\overline {\mathrm {110TT0} }}={\tfrac {\mathrm {1110TT0-1} }{\mathrm {111111\times 1T\times 10} }}={\tfrac {\mathrm {1110TTT} }{\mathrm {111111\times 1T0} }}={\tfrac {\mathrm {111\times 1000T} }{\mathrm {111\times 1001\times 1T0} }}={\tfrac {\mathrm {1111\times 1T} }{\mathrm {1001\times 1T0} }}={\tfrac {1111}{10010}}={\tfrac {\mathrm {1T1T} }{\mathrm {1TTT0} }}={\tfrac {101}{\mathrm {1T10} }}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0.1</mn>
<mrow class="MJX-TeXAtom-ORD">
<mover>
<mrow class="MJX-TeXAtom-ORD">
<mn>110</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
<mo accent="false">¯<!-- ¯ --></mo>
</mover>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mrow class="MJX-TeXAtom-ORD">
<mn>1110</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>111111</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mo>×<!-- × --></mo>
<mn>10</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mrow class="MJX-TeXAtom-ORD">
<mn>1110</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>111111</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mrow class="MJX-TeXAtom-ORD">
<mn>111</mn>
<mo>×<!-- × --></mo>
<mn>1000</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>111</mn>
<mo>×<!-- × --></mo>
<mn>1001</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mrow class="MJX-TeXAtom-ORD">
<mn>1111</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1001</mn>
<mo>×<!-- × --></mo>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mn>1111</mn>
<mn>10010</mn>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mfrac>
<mn>101</mn>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>10</mn>
</mrow>
</mfrac>
</mstyle>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0.1{\overline {\mathrm {110TT0} }}={\tfrac {\mathrm {1110TT0-1} }{\mathrm {111111\times 1T\times 10} }}={\tfrac {\mathrm {1110TTT} }{\mathrm {111111\times 1T0} }}={\tfrac {\mathrm {111\times 1000T} }{\mathrm {111\times 1001\times 1T0} }}={\tfrac {\mathrm {1111\times 1T} }{\mathrm {1001\times 1T0} }}={\tfrac {1111}{10010}}={\tfrac {\mathrm {1T1T} }{\mathrm {1TTT0} }}={\tfrac {101}{\mathrm {1T10} }}}</annotation>
</semantics>
</math></span><img src="./cf5e33c66091cb063900ba4af41d0b3a9eb35c33.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.338ex; width:90.322ex; height:4.009ex;" alt="{\displaystyle 0.1{\overline {\mathrm {110TT0} }}={\tfrac {\mathrm {1110TT0-1} }{\mathrm {111111\times 1T\times 10} }}={\tfrac {\mathrm {1110TTT} }{\mathrm {111111\times 1T0} }}={\tfrac {\mathrm {111\times 1000T} }{\mathrm {111\times 1001\times 1T0} }}={\tfrac {\mathrm {1111\times 1T} }{\mathrm {1001\times 1T0} }}={\tfrac {1111}{10010}}={\tfrac {\mathrm {1T1T} }{\mathrm {1TTT0} }}={\tfrac {101}{\mathrm {1T10} }}}" loading="lazy"></span></dd></dl>
<div class="mw-heading mw-heading3"><h3 id="Conversion_from_unbalanced_ternary">Conversion from unbalanced ternary</h3></div>
<p>Unbalanced ternary can be converted to balanced ternary notation in two ways:
</p>
<ul><li>Add 1 trit-by-trit from the first non-zero trit with carry, and then subtract 1 trit-by-trit from the same trit without borrow. For example,
<dl><dd>021<sub>3</sub> + 11<sub>3</sub> = 102<sub>3</sub>, 102<sub>3</sub> − 11<sub>3</sub> = 1T1<sub>bal3</sub> = 7<sub>dec</sub>.</dd></dl></li>
<li>If a 2 is present in ternary, turn it into 1T. For example,
<dl><dd>0212<sub>3</sub> = 0010<sub>bal3</sub> + 1T00<sub>bal3</sub> + 001T<sub>bal3</sub> = 10TT<sub>bal3</sub> = 23<sub>dec</sub></dd></dl></li></ul>
<table class="wikitable floatright" style="text-align: center">
<tbody><tr>
<th>Balanced</th>
<th>Logic</th>
<th>Unsigned
</th></tr>
<tr>
<td>1</td>
<td>True</td>
<td>2
</td></tr>
<tr>
<td>0</td>
<td>Unknown</td>
<td>1
</td></tr>
<tr>
<td>T</td>
<td>False</td>
<td>0
</td></tr></tbody></table>
<p>If the three values of <a href="Three-valued_logic#Kleene_logic" title="Three-valued logic">ternary logic</a> are <i>false</i>, <i>unknown</i> and <i>true</i>, and these are mapped to balanced ternary as T, 0 and 1 and to conventional unsigned ternary values as 0, 1 and 2, then balanced ternary can be viewed as a biased number system analogous to the <a href="Offset_binary" title="Offset binary">offset binary</a> system.
If the ternary number has <i>n</i> trits, then the bias <i>b</i> is
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle b=\left\lfloor {\frac {3^{n}}{2}}\right\rfloor }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>b</mi>
<mo>=</mo>
<mrow>
<mo>⌊</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msup>
<mn>2</mn>
</mfrac>
</mrow>
<mo>⌋</mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle b=\left\lfloor {\frac {3^{n}}{2}}\right\rfloor }</annotation>
</semantics>
</math></span><img src="./bd90a3e3408552cb19185b332958545f35c9cd2b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -2.505ex; width:10.024ex; height:6.176ex;" alt="{\displaystyle b=\left\lfloor {\frac {3^{n}}{2}}\right\rfloor }" loading="lazy"></span></dd></dl>
<p>which is represented as all ones in either conventional or biased form.<sup id="cite_ref-7" class="reference"><a href="#cite_note-7"><span class="cite-bracket">[</span>7<span class="cite-bracket">]</span></a></sup>
</p><p>As a result, if these two representations are used for balanced and unsigned ternary numbers, an unsigned <i>n</i>-trit positive ternary value can be converted to balanced form by adding the bias <i>b</i> and a positive balanced number can be converted to unsigned form by subtracting the bias <i>b</i>. Furthermore, if <i>x</i> and <i>y</i> are balanced numbers, their balanced sum is <span class="nowrap"><i>x</i> + <i>y</i> − <i>b</i></span> when computed using conventional unsigned ternary arithmetic. Similarly, if <i>x</i> and <i>y</i> are conventional unsigned ternary numbers, their sum is <span class="nowrap"><i>x</i> + <i>y</i> + <i>b</i></span> when computed using balanced ternary arithmetic.
</p>
<div class="mw-heading mw-heading3"><h3 id="Conversion_from_any_integer_base_to_balanced_ternary">Conversion from any integer base to balanced ternary</h3></div>
<p>We may convert to balanced ternary with the following formula:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \left(a_{n}a_{n-1}\cdots a_{1}a_{0}.c_{1}c_{2}c_{3}\cdots \right)_{b}=\sum _{k=0}^{n}a_{k}b^{k}+\sum _{k=1}^{\infty }c_{k}b^{-k}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow>
<mo>(</mo>
<mrow>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msub>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
<mo>−<!-- − --></mo>
<mn>1</mn>
</mrow>
</msub>
<mo>⋯<!-- ⋯ --></mo>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>0</mn>
</mrow>
</msub>
<mo>.</mo>
<msub>
<mi>c</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
</mrow>
</msub>
<msub>
<mi>c</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>2</mn>
</mrow>
</msub>
<msub>
<mi>c</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo>⋯<!-- ⋯ --></mo>
</mrow>
<mo>)</mo>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>b</mi>
</mrow>
</msub>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</munderover>
<msub>
<mi>a</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msub>
<msup>
<mi>b</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msup>
<mo>+</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
<mo>=</mo>
<mn>1</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</munderover>
<msub>
<mi>c</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>k</mi>
</mrow>
</msub>
<msup>
<mi>b</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>−<!-- − --></mo>
<mi>k</mi>
</mrow>
</msup>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \left(a_{n}a_{n-1}\cdots a_{1}a_{0}.c_{1}c_{2}c_{3}\cdots \right)_{b}=\sum _{k=0}^{n}a_{k}b^{k}+\sum _{k=1}^{\infty }c_{k}b^{-k}.}</annotation>
</semantics>
</math></span><img src="./6ccdceb36308535e6a26af8e00bb06ba7f727943.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.171ex; width:52.072ex; height:7.009ex;" alt="{\displaystyle \left(a_{n}a_{n-1}\cdots a_{1}a_{0}.c_{1}c_{2}c_{3}\cdots \right)_{b}=\sum _{k=0}^{n}a_{k}b^{k}+\sum _{k=1}^{\infty }c_{k}b^{-k}.}" loading="lazy"></span></dd></dl>
<p>where,
</p>
<dl><dd><i>a<sub>n</sub>a</i><sub><i>n</i>−1</sub>...<i>a</i><sub>1</sub><i>a</i><sub>0</sub>.<i>c</i><sub>1</sub><i>c</i><sub>2</sub><i>c</i><sub>3</sub>... is the original representation in the original numeral system.</dd>
<dd><i>b</i> is the original radix. <i>b</i> is 10 if converting from decimal.</dd>
<dd><i>a<sub>k</sub></i> and <i>c<sub>k</sub></i> are the digits <i>k</i> places to the left and right of the radix point respectively.</dd></dl>
<p>For instance,
</p>
<pre> −25.4<sub>dec</sub> = −(1T×101<sup>1</sup> + 1TT×101<sup>0</sup> + 11×101<sup>−1</sup>)
= −(1T×101<sup>1</sup> + 1TT×101<sup>0</sup> + 11×101<sup>T</sup>)
= −(1T×101 + 1TT + 11×0.<span style="text-decoration:overline;">010T</span>)
= −(1T1T + 1TT + 0.<span style="text-decoration:overline;">11TT</span>)
= −10T1.<span style="text-decoration:overline;">11TT</span>
= T01T.<span style="text-decoration:overline;">TT11</span>
</pre>
<pre> 1010.1<sub>2</sub> = 1T<sup>10</sup> + 1T<sup>1</sup> + 1T<sup>−1</sup>
= 1T<sup>10</sup> + 1T<sup>1</sup> + 1T<sup>T</sup>
= 10T + 1T + 0.<span style="text-decoration:overline;">1</span>
= 101.<span style="text-decoration:overline;">1</span>
</pre>
<div class="mw-heading mw-heading2"><h2 id="Addition,_subtraction_and_multiplication_and_division">Addition, subtraction and multiplication and division</h2></div>
<p>The single-trit addition, subtraction, multiplication and division tables are shown below. For subtraction and division, which are not <a href="Commutative_property" title="Commutative property">commutative</a>, the first operand is given to the left of the table, while the second is given at the top. For instance, the answer to 1 − T = 1T is found in the bottom left corner of the subtraction table.
</p>
<dl><dd><table>
<tbody><tr>
<td>
<dl><dd><table class="wikitable" style="width: 8em; text-align: center;">
<caption>Addition
</caption>
<tbody><tr align="right">
<th>+</th>
<th>T</th>
<th>0</th>
<th>1
</th></tr>
<tr>
<th>T
</th>
<td>T1</td>
<td>T</td>
<td>0
</td></tr>
<tr>
<th>0
</th>
<td>T</td>
<td>0</td>
<td>1
</td></tr>
<tr>
<th>1
</th>
<td>0</td>
<td>1</td>
<td>1T
</td></tr></tbody></table></dd></dl>
</td>
<td>
<dl><dd><table class="wikitable" style="width: 8em; text-align: center;">
<caption>Subtraction
</caption>
<tbody><tr align="right">
<th>−</th>
<th>T</th>
<th>0</th>
<th>1
</th></tr>
<tr>
<th>T
</th>
<td>0</td>
<td>T</td>
<td>T1
</td></tr>
<tr>
<th>0
</th>
<td>1</td>
<td>0</td>
<td>T
</td></tr>
<tr>
<th>1
</th>
<td>1T</td>
<td>1</td>
<td>0
</td></tr></tbody></table></dd></dl>
</td>
<td>
<dl><dd><table class="wikitable" style="width: 8em; text-align: center;">
<caption>Multiplication
</caption>
<tbody><tr align="right">
<th>×</th>
<th>T</th>
<th>0</th>
<th>1
</th></tr>
<tr>
<th>T
</th>
<td>1</td>
<td>0</td>
<td>T
</td></tr>
<tr>
<th>0
</th>
<td>0</td>
<td>0</td>
<td>0
</td></tr>
<tr>
<th>1
</th>
<td>T</td>
<td>0</td>
<td>1
</td></tr></tbody></table></dd></dl>
</td>
<td>
<dl><dd><table class="wikitable" style="text-align: center;">
<caption>Division
</caption>
<tbody><tr align="right">
<th>÷</th>
<th>T</th>
<th>1
</th></tr>
<tr>
<th>T
</th>
<td>1</td>
<td>T
</td></tr>
<tr>
<th>0
</th>
<td>0</td>
<td>0
</td></tr>
<tr>
<th>1
</th>
<td>T</td>
<td>1
</td></tr></tbody></table></dd></dl>
</td></tr></tbody></table></dd></dl>
<div class="mw-heading mw-heading3"><h3 id="Multi-trit_addition_and_subtraction">Multi-trit addition and subtraction</h3></div>
<p>Multi-trit addition and subtraction is analogous to that of binary and decimal. Add and subtract trit by trit, and add the carry appropriately.
For example:
</p>
<pre> 1TT1TT.1TT1 1TT1TT.1TT1 1TT1TT.1TT1 1TT1TT.1TT1
+ 11T1.T − 11T1.T − 11T1.T → + TT1T.1
______________ ______________ _______________
1T0T10.0TT1 1T1001.TTT1 1T1001.TTT1
+ 1T + T T1 + T T1
______________ ________________ ________________
1T1110.0TT1 1110TT.TTT1 1110TT.TTT1
+ T + T 1 + T 1
______________ ________________ ________________
1T0110.0TT1 1100T.TTT1 1100T.TTT1
</pre>
<div class="mw-heading mw-heading3"><h3 id="Multi-trit_multiplication">Multi-trit multiplication</h3></div>
<p>Multi-trit multiplication is analogous to that of binary and decimal.
</p>
<pre> 1TT1.TT
× T11T.1
_____________
1TT.1TT multiply 1
T11T.11 multiply T
1TT1T.T multiply 1
1TT1TT multiply 1
T11T11 multiply T
_____________
0T0000T.10T
</pre>
<div class="mw-heading mw-heading3"><h3 id="Multi-trit_division">Multi-trit division</h3></div>
<p>Balanced ternary division is analogous to that of binary and decimal.
</p><p>However, 0.5<sub>dec</sub> = 0.1111...<sub>bal3</sub> or 1.TTTT...<sub>bal3</sub>. If the dividend over the plus or minus half divisor, the trit of the quotient must be 1 or T. If the dividend is between the plus and minus of half the divisor, the trit of the quotient is 0. The magnitude of the dividend must be compared with that of half the divisor before setting the quotient trit. For example,
</p>
<pre> 1TT1.TT quotient
0.5 × divisor T01.0 _____________
divisor T11T.1 ) T0000T.10T dividend
T11T1 T000 < T010, set 1
_______
1T1T0
1TT1T 1T1T0 > 10T0, set T
_______
111T
1TT1T 111T > 10T0, set T
_______
T00.1
T11T.1 T001 < T010, set 1
________
1T1.00
1TT.1T 1T100 > 10T0, set T
________
1T.T1T
1T.T1T 1TT1T > 10T0, set T
________
0
</pre>
<p>Another example,
</p>
<pre> 1TTT
0.5 × divisor 1T _______
Divisor 11 )1T01T 1T = 1T, but 1T.01 > 1T, set 1
11
_____
T10 T10 < T1, set T
TT
______
T11 T11 < T1, set T
TT
______
TT TT < T1, set T
TT
____
0
</pre>
<p>Another example,
</p>
<pre> 101.TTTTTTTTT...
or 100.111111111...
0.5 × divisor 1T _________________
divisor 11 )111T 11 > 1T, set 1
11
_____
1 T1 < 1 < 1T, set 0
___
1T 1T = 1T, trits end, set 1.TTTTTTTTT... or 0.111111111...
</pre>
<p>In balanced ternary, there is a simpler division method that does not require comparing the remainders and operates directly according to the rules. This method originated from <a href="Donald_Knuth" title="Donald Knuth">Donald Knuth</a> trial <a rel="nofollow" class="external text" href="https://dfns.dyalog.com/n_bt.htm">quotient method</a>, but this method is not perfect. Later, it was improved by other scholars, completely abandoning the judgment of semi-closed intervals and instead using the condition of whether the highest bit of the remainder of each round of division is 0 to determine whether the round of division is over, and named it the double trial quotient method: the core logic is to split the dividend into two vectors (p and s), where the number of digits of p is at most the same as the divisor q, and s is the vector of the remaining digits; then according to the rule (double positive or double negative gives a positive quotient, one positive and one negative gives a negative quotient, and the others are 0), the quotient is subtracted at most once or twice in each round of division. If the highest bit of the remainder p is still not 0 after subtraction once, it needs to be subtracted again. If the highest bit of the remainder p is 0, the round of division is over, and the bit is the double quotient. The value is doubled and the result is given to register r; then the remainder p Shift left one bit, discard the highest bit of the previous round's divisor (already 0), pull one bit of s to supplement it, and get the new remainder p to carry on to the next round. The result r (3 times magnified) is shifted right one bit and supplemented with 0. Then, when s is exhausted, the result r and the dividend p constitute the final quotient and remainder.
</p>
<pre> +
++0- ++
_____________ _______
+0- )+0++0+ +- )+0+
-0+ -+
____________ ______
0+-+ 0++
-0+ -+
____________ ______
00-0 +-
000 -+
____________ ______
-0+ 0
+0-
____________ Add +0 and +- ,quotient get +--
0
</pre>
<div class="mw-heading mw-heading2"><h2 id="Square_roots_and_cube_roots">Square roots and cube roots</h2></div>
<p>The process of extracting the <a href="Square_root" title="Square root">square root</a> in balanced ternary is analogous to that in decimal or binary.
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10\cdot x+y)^{\mathrm {1T} }-100\cdot x^{\mathrm {1T} }=\mathrm {1T0} \cdot x\cdot y+y^{\mathrm {1T} }={\begin{cases}\mathrm {T10} \cdot x+1,&y=\mathrm {T} \\0,&y=0\\\mathrm {1T0} \cdot x+1,&y=1\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mi>y</mi>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mn>100</mn>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>⋅<!-- ⋅ --></mo>
<mi>y</mi>
<mo>+</mo>
<msup>
<mi>y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mn>10</mn>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mn>1</mn>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10\cdot x+y)^{\mathrm {1T} }-100\cdot x^{\mathrm {1T} }=\mathrm {1T0} \cdot x\cdot y+y^{\mathrm {1T} }={\begin{cases}\mathrm {T10} \cdot x+1,&y=\mathrm {T} \\0,&y=0\\\mathrm {1T0} \cdot x+1,&y=1\end{cases}}}</annotation>
</semantics>
</math></span><img src="./83c930356757c3a3a467a651aee17470c63e42c0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.671ex; width:69.976ex; height:8.509ex;" alt="{\displaystyle (10\cdot x+y)^{\mathrm {1T} }-100\cdot x^{\mathrm {1T} }=\mathrm {1T0} \cdot x\cdot y+y^{\mathrm {1T} }={\begin{cases}\mathrm {T10} \cdot x+1,&y=\mathrm {T} \\0,&y=0\\\mathrm {1T0} \cdot x+1,&y=1\end{cases}}}" loading="lazy"></span></dd></dl>
<p>As in division, we should check the value of half the divisor first. For example,
</p>
<pre> 1. 1 1 T 1 T T 0 0 ...
_________________________
√ 1T 1<1T<11, set 1
− 1
_____
1×10=10 1.0T 1.0T>0.10, set 1
1T0 −1.T0
________
11×10=110 1T0T 1T0T>110, set 1
10T0 −10T0
________
111×10=1110 T1T0T T1T0T<TTT0, set T
100T0 −T0010
_________
111T×10=111T0 1TTT0T 1TTT0T>111T0, set 1
10T110 −10T110
__________
111T1×10=111T10 TT1TT0T TT1TT0T<TTT1T0, set T
100TTT0 −T001110
___________
111T1T×10=111T1T0 T001TT0T T001TT0T<TTT1T10, set T
10T11110 −T01TTTT0
____________
111T1TT×10=111T1TT0 T001T0T TTT1T110<T001T0T<111T1TT0, set 0
− T Return 1
___________
111T1TT0×10=111T1TT00 T001T000T TTT1T1100<T001T000T<111T1TT00, set 0
− T Return 1
_____________
111T1TT00*10=111T1TT000 T001T00000T
...
</pre>
<p>Extraction of the cube root in balanced ternary is similarly analogous to extraction in decimal or binary:
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle (10\cdot x+y)^{10}-1000\cdot x^{10}=1000\cdot x^{\mathrm {1T} }\cdot y+100\cdot x\cdot y^{\mathrm {1T} }+y^{10}={\begin{cases}\mathrm {T000} \cdot x^{\mathrm {1T} }+100\cdot x+\mathrm {T} ,&y=\mathrm {T} \\0,&y=0\\1000\cdot x^{\mathrm {1T} }+100\cdot x+1,&y=1\end{cases}}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo stretchy="false">(</mo>
<mn>10</mn>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mi>y</mi>
<msup>
<mo stretchy="false">)</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>10</mn>
</mrow>
</msup>
<mo>−<!-- − --></mo>
<mn>1000</mn>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>10</mn>
</mrow>
</msup>
<mo>=</mo>
<mn>1000</mn>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>⋅<!-- ⋅ --></mo>
<mi>y</mi>
<mo>+</mo>
<mn>100</mn>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>+</mo>
<msup>
<mi>y</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>10</mn>
</mrow>
</msup>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mrow>
<mo>{</mo>
<mtable columnalign="left left" rowspacing=".2em" columnspacing="1em" displaystyle="false">
<mtr>
<mtd>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
<mn>000</mn>
</mrow>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>+</mo>
<mn>100</mn>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
</mrow>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">T</mi>
</mrow>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>0</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mn>0</mn>
</mtd>
</mtr>
<mtr>
<mtd>
<mn>1000</mn>
<mo>⋅<!-- ⋅ --></mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mrow>
</msup>
<mo>+</mo>
<mn>100</mn>
<mo>⋅<!-- ⋅ --></mo>
<mi>x</mi>
<mo>+</mo>
<mn>1</mn>
<mo>,</mo>
</mtd>
<mtd>
<mi>y</mi>
<mo>=</mo>
<mn>1</mn>
</mtd>
</mtr>
</mtable>
<mo fence="true" stretchy="true" symmetric="true"></mo>
</mrow>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle (10\cdot x+y)^{10}-1000\cdot x^{10}=1000\cdot x^{\mathrm {1T} }\cdot y+100\cdot x\cdot y^{\mathrm {1T} }+y^{10}={\begin{cases}\mathrm {T000} \cdot x^{\mathrm {1T} }+100\cdot x+\mathrm {T} ,&y=\mathrm {T} \\0,&y=0\\1000\cdot x^{\mathrm {1T} }+100\cdot x+1,&y=1\end{cases}}}</annotation>
</semantics>
</math></span><img src="./3ff80005882182a522174770e1b11cd63ab08253.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.487ex; margin-bottom: -0.184ex; width:100.604ex; height:8.509ex;" alt="{\displaystyle (10\cdot x+y)^{10}-1000\cdot x^{10}=1000\cdot x^{\mathrm {1T} }\cdot y+100\cdot x\cdot y^{\mathrm {1T} }+y^{10}={\begin{cases}\mathrm {T000} \cdot x^{\mathrm {1T} }+100\cdot x+\mathrm {T} ,&y=\mathrm {T} \\0,&y=0\\1000\cdot x^{\mathrm {1T} }+100\cdot x+1,&y=1\end{cases}}}" loading="lazy"></span></dd></dl>
<p>Like division, we should check the value of half the divisor first too.
For example:
</p>
<pre> 1. 1 T 1 0 ...
_____________________
¹⁰√ 1T
− 1 1<1T<10T,set 1
_______
1.000
1×100=100 −0.100 borrow 100×, do division
_______
1TT 1.T00 1T00>1TT, set 1
1×1×1000+1=1001 −1.001
__________
T0T000
11×100 − 1100 borrow 100×, do division
_________
10T000 TT1T00 TT1T00<T01000, set T
11×11×1000+1=1TT1001 −T11T00T
____________
1TTT01000
11T×100 − 11T00 borrow 100×, do division
___________
1T1T01TT 1TTTT0100 1TTTT0100>1T1T01TT, set 1
11T×11T×1000+1=11111001 − 11111001
______________
1T10T000
11T1×100 − 11T100 borrow 100×, do division
__________
10T0T01TT 1T0T0T00 T01010T11<1T0T0T00<10T0T01TT, set 0
11T1×11T1×1000+1=1TT1T11001 − TT1T00 return 100×
_____________
1T10T000000
...
</pre>
<p>Hence <span class="nowrap"><sup style="margin-right: -0.5em; vertical-align: 0.8em;">3</sup>√<span style="border-top:1px solid; padding:0 0.1em;">2</span></span><sub>dec</sub> = <span class="nowrap"><sup style="margin-right: -0.5em; vertical-align: 0.8em;">10</sup>√<span style="border-top:1px solid; padding:0 0.1em;">1T</span></span><sub>bal3</sub> = 1.259921<sub>dec</sub> = 1.1T1 000 111 001 T01 00T 1T1 T10 111<sub>bal3</sub>.
</p>
<div class="mw-heading mw-heading2"><h2 id="Irrational_numbers">Irrational numbers</h2></div>
<p>As in any other integer base, algebraic irrationals and transcendental numbers do not terminate or repeat. For example:
</p>
<dl><dd><table class="wikitable">
<tbody><tr>
<th>Decimal</th>
<th>Balanced ternary
</th></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {2}}=1.4142135623731\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>2</mn>
</msqrt>
</mrow>
<mo>=</mo>
<mn>1.4142135623731</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {2}}=1.4142135623731\ldots }</annotation>
</semantics>
</math></span><img src="./a599124d2f0e66f17e809c668dd70c5d40a5f843.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:26.228ex; height:3.009ex;" alt="{\displaystyle {\sqrt {2}}=1.4142135623731\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {\mathrm {1T} }}=\mathrm {1.11T1TT00T00T01T0T00T00T01TT\ldots } }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</msqrt>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1.11</mn>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>00</mn>
<mi mathvariant="normal">T</mi>
<mn>00</mn>
<mi mathvariant="normal">T</mi>
<mn>01</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>00</mn>
<mi mathvariant="normal">T</mi>
<mn>00</mn>
<mi mathvariant="normal">T</mi>
<mn>01</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mo>…<!-- … --></mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {\mathrm {1T} }}=\mathrm {1.11T1TT00T00T01T0T00T00T01TT\ldots } }</annotation>
</semantics>
</math></span><img src="./c25c74444a63f8a0650a112bbf2f20bb602ed186.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:49.853ex; height:3.009ex;" alt="{\displaystyle {\sqrt {\mathrm {1T} }}=\mathrm {1.11T1TT00T00T01T0T00T00T01TT\ldots } }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {3}}=1.7320508075689\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>3</mn>
</msqrt>
</mrow>
<mo>=</mo>
<mn>1.7320508075689</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {3}}=1.7320508075689\ldots }</annotation>
</semantics>
</math></span><img src="./1dc19e2ae003e783cae5cabe6d79ab80cba629e8.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:26.228ex; height:2.843ex;" alt="{\displaystyle {\sqrt {3}}=1.7320508075689\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {\mathrm {10} }}=\mathrm {1T.T1TT10T0000TT1100T0TTT011T0\ldots } }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mrow class="MJX-TeXAtom-ORD">
<mn>10</mn>
</mrow>
</msqrt>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mo>.</mo>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>10</mn>
<mi mathvariant="normal">T</mi>
<mn>0000</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>1100</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>011</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mo>…<!-- … --></mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {\mathrm {10} }}=\mathrm {1T.T1TT10T0000TT1100T0TTT011T0\ldots } }</annotation>
</semantics>
</math></span><img src="./e848cf41e8b8c1a07765a099ae239e57fc75e538.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:51.402ex; height:2.843ex;" alt="{\displaystyle {\sqrt {\mathrm {10} }}=\mathrm {1T.T1TT10T0000TT1100T0TTT011T0\ldots } }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {5}}=2.2360679774998\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>5</mn>
</msqrt>
</mrow>
<mo>=</mo>
<mn>2.2360679774998</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {5}}=2.2360679774998\ldots }</annotation>
</semantics>
</math></span><img src="./1bc87b6a7d86315c0fadae71425fbbbaa181ea1a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:26.228ex; height:2.843ex;" alt="{\displaystyle {\sqrt {5}}=2.2360679774998\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\sqrt {\mathrm {1TT} }}=\mathrm {1T.1T0101010TTT1TT11010TTT01T1\ldots } }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</msqrt>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>.1</mn>
<mi mathvariant="normal">T</mi>
<mn>0101010</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>11010</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>01</mn>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mo>…<!-- … --></mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\sqrt {\mathrm {1TT} }}=\mathrm {1T.1T0101010TTT1TT11010TTT01T1\ldots } }</annotation>
</semantics>
</math></span><img src="./a7e1d079ba9ee31810d2bcb1172303a8e31262c0.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:52.693ex; height:3.009ex;" alt="{\displaystyle {\sqrt {\mathrm {1TT} }}=\mathrm {1T.1T0101010TTT1TT11010TTT01T1\ldots } }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\textstyle \varphi ={\frac {1+{\sqrt {5}}}{2}}=1.6180339887499\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mi>φ<!-- φ --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mn>1</mn>
<mo>+</mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mn>5</mn>
</msqrt>
</mrow>
</mrow>
<mn>2</mn>
</mfrac>
</mrow>
<mo>=</mo>
<mn>1.6180339887499</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\textstyle \varphi ={\frac {1+{\sqrt {5}}}{2}}=1.6180339887499\ldots }</annotation>
</semantics>
</math></span><img src="./47b62f1af1081c73913310774f45b2244af3cb68.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:32.876ex; height:4.176ex;" alt="{\textstyle \varphi ={\frac {1+{\sqrt {5}}}{2}}=1.6180339887499\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\textstyle \varphi ={\frac {1+{\sqrt {\mathrm {1TT} }}}{\mathrm {1T} }}=\mathrm {1T.T0TT01TT0T10TT11T0011T10011\ldots } }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="false" scriptlevel="0">
<mi>φ<!-- φ --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mfrac>
<mrow>
<mn>1</mn>
<mo>+</mo>
<mrow class="MJX-TeXAtom-ORD">
<msqrt>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
</mrow>
</msqrt>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
</mrow>
</mfrac>
</mrow>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mo>.</mo>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>01</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>10</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>11</mn>
<mi mathvariant="normal">T</mi>
<mn>0011</mn>
<mi mathvariant="normal">T</mi>
<mn>10011</mn>
<mo>…<!-- … --></mo>
</mrow>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\textstyle \varphi ={\frac {1+{\sqrt {\mathrm {1TT} }}}{\mathrm {1T} }}=\mathrm {1T.T0TT01TT0T10TT11T0011T10011\ldots } }</annotation>
</semantics>
</math></span><img src="./134da5439db965a4f9d70df8c95506a86366d56d.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -1.171ex; width:58.745ex; height:4.176ex;" alt="{\textstyle \varphi ={\frac {1+{\sqrt {\mathrm {1TT} }}}{\mathrm {1T} }}=\mathrm {1T.T0TT01TT0T10TT11T0011T10011\ldots } }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau =6.28318530717959\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
<mo>=</mo>
<mn>6.28318530717959</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau =6.28318530717959\ldots }</annotation>
</semantics>
</math></span><img src="./fc17d01d3cb58ae3bdb10ee0cd2f7a1312b6f22b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:25.494ex; height:2.176ex;" alt="{\displaystyle \tau =6.28318530717959\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \tau =\mathrm {1T0.10TT0T1100T110TT0T1TT000001} \ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>τ<!-- τ --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mn>0.10</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>1100</mn>
<mi mathvariant="normal">T</mi>
<mn>110</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>1</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>000001</mn>
</mrow>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \tau =\mathrm {1T0.10TT0T1100T110TT0T1TT000001} \ldots }</annotation>
</semantics>
</math></span><img src="./5df3d54b54130acbcc3d743db2090f009d18fc67.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:48.087ex; height:2.176ex;" alt="{\displaystyle \tau =\mathrm {1T0.10TT0T1100T110TT0T1TT000001} \ldots }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \pi =3.14159265358979\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>π<!-- π --></mi>
<mo>=</mo>
<mn>3.14159265358979</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \pi =3.14159265358979\ldots }</annotation>
</semantics>
</math></span><img src="./6de554f9fba9eb9849cf9f5ed6d193922b0dc765.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:25.624ex; height:2.176ex;" alt="{\displaystyle \pi =3.14159265358979\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \pi =\mathrm {10.011T111T000T011T1101T111111} \ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>π<!-- π --></mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>10.011</mn>
<mi mathvariant="normal">T</mi>
<mn>111</mn>
<mi mathvariant="normal">T</mi>
<mn>000</mn>
<mi mathvariant="normal">T</mi>
<mn>011</mn>
<mi mathvariant="normal">T</mi>
<mn>1101</mn>
<mi mathvariant="normal">T</mi>
<mn>111111</mn>
</mrow>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \pi =\mathrm {10.011T111T000T011T1101T111111} \ldots }</annotation>
</semantics>
</math></span><img src="./569017f1e8f048a919c2044b697b4a1768c454bb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:44.477ex; height:2.176ex;" alt="{\displaystyle \pi =\mathrm {10.011T111T000T011T1101T111111} \ldots }" loading="lazy"></span>
</td></tr>
<tr>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e=2.71828182845905\ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>e</mi>
<mo>=</mo>
<mn>2.71828182845905</mn>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle e=2.71828182845905\ldots }</annotation>
</semantics>
</math></span><img src="./36477e2c60a49407e38dbc4679274727973236dd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:25.376ex; height:2.176ex;" alt="{\displaystyle e=2.71828182845905\ldots }" loading="lazy"></span></td>
<td><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e=\mathrm {10.T0111TT0T0T111T0111T000T11T} \ldots }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>e</mi>
<mo>=</mo>
<mrow class="MJX-TeXAtom-ORD">
<mn>10.</mn>
<mi mathvariant="normal">T</mi>
<mn>0111</mn>
<mi mathvariant="normal">T</mi>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>0</mn>
<mi mathvariant="normal">T</mi>
<mn>111</mn>
<mi mathvariant="normal">T</mi>
<mn>0111</mn>
<mi mathvariant="normal">T</mi>
<mn>000</mn>
<mi mathvariant="normal">T</mi>
<mn>11</mn>
<mi mathvariant="normal">T</mi>
</mrow>
<mo>…<!-- … --></mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle e=\mathrm {10.T0111TT0T0T111T0111T000T11T} \ldots }</annotation>
</semantics>
</math></span><img src="./f052b2921df42f2fab67ecc8ebfa40823756f944.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:46.291ex; height:2.176ex;" alt="{\displaystyle e=\mathrm {10.T0111TT0T0T111T0111T000T11T} \ldots }" loading="lazy"></span>
</td></tr></tbody></table></dd></dl>
<p>The balanced ternary expansions of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \pi }">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>π<!-- π --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \pi }</annotation>
</semantics>
</math></span><img src="./9be4ba0bb8df3af72e90a0535fabcc17431e540a.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.332ex; height:1.676ex;" alt="{\displaystyle \pi }" loading="lazy"></span> is given in <a href="OEIS" class="mw-redirect" title="OEIS">OEIS</a> as <a href="https://oeis.org/A331313" class="extiw external" title="oeis:A331313">A331313</a>, that of <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle e}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>e</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle e}</annotation>
</semantics>
</math></span><img src="./cd253103f0876afc68ebead27a5aa9867d927467.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.083ex; height:1.676ex;" alt="{\displaystyle e}" loading="lazy"></span> in <a href="https://oeis.org/A331990" class="extiw external" title="oeis:A331990">A331990</a>.
</p><p><br>
</p>
<div class="mw-heading mw-heading2"><h2 id="Applications">Applications</h2></div>
<div class="mw-heading mw-heading3"><h3 id="In_computer_design">In computer design</h3></div>
<p>In the early days of computing, a few experimental Soviet computers were built with balanced ternary instead of binary, the most famous being the <a href="Setun" title="Setun">Setun</a>, built by <a href="Nikolay_Brusentsov" title="Nikolay Brusentsov">Nikolay Brusentsov</a> and <a href="Sergei_Sobolev" title="Sergei Sobolev">Sergei Sobolev</a>. The notation has a number of computational advantages over traditional binary and ternary. Particularly, the plus–minus consistency cuts down the carry rate in multi-digit multiplication, and the rounding–truncation equivalence cuts down the carry rate in rounding on fractions. In balanced ternary, the one-digit <a href="Multiplication_table" title="Multiplication table">multiplication table</a> remains one-digit and has no carry and the <a href="Addition_table" class="mw-redirect" title="Addition table">addition table</a> has only two carries out of nine entries, compared to unbalanced ternary with one and three respectively. Knuth wrote that "Perhaps the symmetric properties and simple arithmetic of this number system will prove to be quite important some day,"<sup id="cite_ref-Knuth_6-1" class="reference"><a href="#cite_note-Knuth-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup> noting that,
</p>
<style data-mw-deduplicate="TemplateStyles:r1244412712">
/* start https://en.wikipedia.org/ */
.mw-parser-output .templatequote{overflow:hidden;margin:1em 0;padding:0 32px}.mw-parser-output .templatequotecite{line-height:1.5em;text-align:left;margin-top:0}@media(min-width:500px){.mw-parser-output .templatequotecite{padding-left:1.6em}}
/* end https://en.wikipedia.org/ */
</style><blockquote class="templatequote"><p>The complexity of arithmetic circuitry for balanced ternary arithmetic is not much greater than it is for the binary system, and a given number requires only <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \log _{3}2\approx 63\%}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>log</mi>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
<mo><!-- --></mo>
<mn>2</mn>
<mo>≈<!-- ≈ --></mo>
<mn>63</mn>
<mi mathvariant="normal">%<!-- % --></mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \log _{3}2\approx 63\%}</annotation>
</semantics>
</math></span><img src="./46ef74db519d35cf6361c4785026ff1a3aa95257.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:12.935ex; height:2.843ex;" alt="{\displaystyle \log _{3}2\approx 63\%}" loading="lazy"></span> as many digit positions for its representation."<sup id="cite_ref-Knuth_6-2" class="reference"><a href="#cite_note-Knuth-6"><span class="cite-bracket">[</span>6<span class="cite-bracket">]</span></a></sup></p></blockquote>
<p>More recently, balanced ternary numbers have been proposed for some highly-efficient low-resolution implementations of <a href="Artificial_neural_networks" class="mw-redirect" title="Artificial neural networks">artificial neural networks</a>. In <a href="Deep_learning" title="Deep learning">deep learning</a>, neural nets usually use continuous (floating-point) values, but there are many works investigating quantisation and binarisation to create neural nets that can run with much lower power and/or lower memory requirements. Balanced ternary numbers are proposed to be used for the network parameters, because they are extremely compact, but can naturally represent excitatory/inhibitory/null activation patterns.<sup id="cite_ref-8" class="reference"><a href="#cite_note-8"><span class="cite-bracket">[</span>8<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-9" class="reference"><a href="#cite_note-9"><span class="cite-bracket">[</span>9<span class="cite-bracket">]</span></a></sup>
</p><p>Balanced ternary may also provide a more natural representation for the <a href="Qutrit" title="Qutrit">qutrit</a> and quantum computing systems that use it.
</p>
<div class="mw-heading mw-heading3"><h3 id="Other_applications">Other applications</h3></div>
<p>The theorem that every integer has a unique representation in balanced ternary was used by <a href="Leonhard_Euler" title="Leonhard Euler">Leonhard Euler</a> to justify the identity of <a href="Formal_power_series" title="Formal power series">formal power series</a><sup id="cite_ref-10" class="reference"><a href="#cite_note-10"><span class="cite-bracket">[</span>10<span class="cite-bracket">]</span></a></sup>
</p>
<dl><dd><span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \prod _{n=0}^{\infty }\left(x^{-3^{n}}+1+x^{3^{n}}\right)=\sum _{n=-\infty }^{\infty }x^{n}.}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<munderover>
<mo>∏<!-- ∏ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
<mo>=</mo>
<mn>0</mn>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</munderover>
<mrow>
<mo>(</mo>
<mrow>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mo>−<!-- − --></mo>
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msup>
</mrow>
</msup>
<mo>+</mo>
<mn>1</mn>
<mo>+</mo>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<msup>
<mn>3</mn>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msup>
</mrow>
</msup>
</mrow>
<mo>)</mo>
</mrow>
<mo>=</mo>
<munderover>
<mo>∑<!-- ∑ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
<mo>=</mo>
<mo>−<!-- − --></mo>
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="normal">∞<!-- ∞ --></mi>
</mrow>
</munderover>
<msup>
<mi>x</mi>
<mrow class="MJX-TeXAtom-ORD">
<mi>n</mi>
</mrow>
</msup>
<mo>.</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \prod _{n=0}^{\infty }\left(x^{-3^{n}}+1+x^{3^{n}}\right)=\sum _{n=-\infty }^{\infty }x^{n}.}</annotation>
</semantics>
</math></span><img src="./398f6d4fab1ed573bd34741c9ace94b9a571377e.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -3.005ex; width:32.936ex; height:6.843ex;" alt="{\displaystyle \prod _{n=0}^{\infty }\left(x^{-3^{n}}+1+x^{3^{n}}\right)=\sum _{n=-\infty }^{\infty }x^{n}.}" loading="lazy"></span></dd></dl>
<p>Balanced ternary has other applications besides computing. For example, a classical two-pan <a href="Weighing_scale#Balance" title="Weighing scale">balance</a>, with one weight for each power of 3, can weigh relatively heavy objects accurately with a small number of weights, by moving weights between the two pans and the table. For example, with weights for each power of 3 through 81, a 60-gram object (60<sub>dec</sub> = 1T1T0<sub>bal3</sub>) will be balanced perfectly with an 81 gram weight in the other pan, the 27 gram weight in its own pan, the 9 gram weight in the other pan, the 3 gram weight in its own pan, and the 1 gram weight set aside.
</p><p>Similarly, consider a currency system with coins worth 1¤, 3¤, 9¤, 27¤, 81¤. If the buyer and the seller each have only one of each kind of coin, any transaction up to 121¤ is possible. For example, if the price is 7¤ (7<sub>dec</sub> = 1T1<sub>bal3</sub>), the buyer pays 1¤ + 9¤ and receives 3¤ in change.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Signed-digit_representation" title="Signed-digit representation">Signed-digit representation</a></li>
<li><a href="Methods_of_computing_square_roots" class="mw-redirect" title="Methods of computing square roots">Methods of computing square roots</a></li>
<li><a href="Numeral_system" title="Numeral system">Numeral system</a></li>
<li><a href="Qutrit" title="Qutrit">Qutrit</a></li>
<li><a href="Salamis_Tablet" title="Salamis Tablet">Salamis Tablet</a></li>
<li><a href="Ternary_computer" title="Ternary computer">Ternary computer</a>
<ul><li><a href="Setun" title="Setun">Setun</a>, a ternary computer</li></ul></li>
<li><a href="Ternary_logic" class="mw-redirect" title="Ternary logic">Ternary logic</a></li>
<li><a href="Generalized_balanced_ternary" title="Generalized balanced ternary">Generalized balanced ternary</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */
.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}
/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-setun-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-setun_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-setun_1-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */
.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}
/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFN._A._KrinitskyG._A._MironovG._D._Frolov1963" class="citation book cs1 cs1-prop-foreign-lang-source">N. A. Krinitsky; G. A. Mironov; G. D. Frolov (1963). "Chapter 10. Program-controlled machine Setun". In M. R. Shura-Bura (ed.). <i>Programming</i> (in Russian). Moscow.</cite><span class="cs1-maint citation-comment"><code class="cs1-code">{{cite book}}</code>: CS1 maint: location missing publisher (link)</span></span>
</li>
<li id="cite_note-hayes-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-hayes_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-hayes_2-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFHayes2001" class="citation cs2"><a href="Brian_Hayes_(scientist)" title="Brian Hayes (scientist)">Hayes, Brian</a> (2001), <a rel="nofollow" class="external text" href="http://bit-player.org/bph-publications/AmSci-2001-11-Hayes-ternary.pdf">"Third base"</a> <span class="cs1-format">(PDF)</span>, <i>American Scientist</i>, <b>89</b> (6): <span class="nowrap">490–</span>494, <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1511%2F2001.40.3268">10.1511/2001.40.3268</a></cite>. Reprinted in <cite id="CITEREFHayes2008" class="citation cs2"><a href="Brian_Hayes_(scientist)" title="Brian Hayes (scientist)">Hayes, Brian</a> (2008), <a rel="nofollow" class="external text" href="https://books.google.com/books?id=1ZkYEFi3DMMC&pg=PA179"><i>Group Theory in the Bedroom, and Other Mathematical Diversions</i></a>, Farrar, Straus and Giroux, pp. <span class="nowrap">179–</span>200, <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>9781429938570</bdi></cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFStifel1544" class="citation cs2 cs1-prop-foreign-lang-source"><a href="Michael_Stifel" title="Michael Stifel">Stifel, Michael</a> (1544), <a rel="nofollow" class="external text" href="https://archive.org/stream/bub_gb_ywkW9hDd7IIC#page/n85/mode/2up"><i>Arithmetica integra</i></a> (in Latin), apud Iohan Petreium, p. 38</cite>.</span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text">The symbols <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0}</annotation>
</semantics>
</math></span><img src="./2aae8864a3c1fec9585261791a809ddec1489950.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.176ex;" alt="{\displaystyle 0}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 1}</annotation>
</semantics>
</math></span><img src="./92d98b82a3778f043108d4e20960a9193df57cbf.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.176ex;" alt="{\displaystyle 1}" loading="lazy"></span> appear twice in the equalities <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{}(0)=0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f_{}(0)=0}</annotation>
</semantics>
</math></span><img src="./359cf947c64090f9d6bc2e2250a082c347c326cb.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:8.511ex; height:2.843ex;" alt="{\displaystyle f_{}(0)=0}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f_{}(1)=1,}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mi>f</mi>
<mrow class="MJX-TeXAtom-ORD">
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo>=</mo>
<mn>1</mn>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f_{}(1)=1,}</annotation>
</semantics>
</math></span><img src="./f25386adbe6d79bce0df8e7a957f2e97a7725b63.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.838ex; width:9.158ex; height:2.843ex;" alt="{\displaystyle f_{}(1)=1,}" loading="lazy"></span> but these instances do not represent the same thing. The right hand side <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 0}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>0</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 0}</annotation>
</semantics>
</math></span><img src="./2aae8864a3c1fec9585261791a809ddec1489950.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.176ex;" alt="{\displaystyle 0}" loading="lazy"></span> and <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle 1}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mn>1</mn>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle 1}</annotation>
</semantics>
</math></span><img src="./92d98b82a3778f043108d4e20960a9193df57cbf.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.338ex; width:1.162ex; height:2.176ex;" alt="{\displaystyle 1}" loading="lazy"></span> mean the integers <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle \in \mathbb {Z} ,}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mo>∈<!-- ∈ --></mo>
<mrow class="MJX-TeXAtom-ORD">
<mi mathvariant="double-struck">Z</mi>
</mrow>
<mo>,</mo>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle \in \mathbb {Z} ,}</annotation>
</semantics>
</math></span><img src="./fc467ab47a0a52911acad5509d669c0da9805dcd.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:4.393ex; height:2.509ex;" alt="{\displaystyle \in \mathbb {Z} ,}" loading="lazy"></span> but the instances inside <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle f}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<mi>f</mi>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle f}</annotation>
</semantics>
</math></span><img src="./132e57acb643253e7810ee9702d9581f159a1c61.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:1.279ex; height:2.509ex;" alt="{\displaystyle f}" loading="lazy"></span>'s parentheses (which belong to <span class="mwe-math-element mwe-math-element-inline"><span class="mwe-math-mathml-inline mwe-math-mathml-a11y" style="display: none;"><math xmlns="http://www.w3.org/1998/Math/MathML" alttext="{\displaystyle {\mathcal {D}}_{3}}">
<semantics>
<mrow class="MJX-TeXAtom-ORD">
<mstyle displaystyle="true" scriptlevel="0">
<msub>
<mrow class="MJX-TeXAtom-ORD">
<mrow class="MJX-TeXAtom-ORD">
<mi class="MJX-tex-caligraphic" mathvariant="script">D</mi>
</mrow>
</mrow>
<mrow class="MJX-TeXAtom-ORD">
<mn>3</mn>
</mrow>
</msub>
</mstyle>
</mrow>
<annotation encoding="application/x-tex">{\displaystyle {\mathcal {D}}_{3}}</annotation>
</semantics>
</math></span><img src="./ed525b93bf294538e4252b31cc93182d3444609b.svg" class="mwe-math-fallback-image-inline mw-invert skin-invert" aria-hidden="true" style="vertical-align: -0.671ex; width:2.846ex; height:2.509ex;" alt="{\displaystyle {\mathcal {D}}_{3}}" loading="lazy"></span>) should be thought of as being nothing more than symbols.</span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFBhattacharjee2006" class="citation web cs1">Bhattacharjee, Abhijit (24 July 2006). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20090919053547/http://www.abhijit.info/tristate/tristate.html">"Balanced ternary"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.abhijit.info/tristate/tristate.html">the original</a> on 2009-09-19.</cite></span>
</li>
<li id="cite_note-Knuth-6"><span class="mw-cite-backlink">^ <a href="#cite_ref-Knuth_6-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-Knuth_6-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-Knuth_6-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFKnuth1997" class="citation book cs1"><a href="Donald_Knuth" title="Donald Knuth">Knuth, Donald</a> (1997). <i>The art of Computer Programming</i>. Vol. 2. Addison-Wesley. pp. <span class="nowrap">195–</span>213. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a> <bdi>0-201-89684-2</bdi>.</cite></span>
</li>
<li id="cite_note-7"><span class="mw-cite-backlink"><b><a href="#cite_ref-7">^</a></b></span> <span class="reference-text">Douglas W. Jones, <a rel="nofollow" class="external text" href="http://www.cs.uiowa.edu/~jones/ternary/numbers.shtml">Ternary Number Systems</a>, October 15, 2013.</span>
</li>
<li id="cite_note-8"><span class="mw-cite-backlink"><b><a href="#cite_ref-8">^</a></b></span> <span class="reference-text"><cite id="CITEREFLi2022" class="citation arxiv cs1">Li, Fengfu (2022). "Ternary Weight Networks". <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/1605.04711">1605.04711</a></span> [<a rel="nofollow" class="external text" href="https://arxiv.org/archive/cs.CV">cs.CV</a>].</cite></span>
</li>
<li id="cite_note-9"><span class="mw-cite-backlink"><b><a href="#cite_ref-9">^</a></b></span> <span class="reference-text"><cite id="CITEREFMa2024" class="citation arxiv cs1">Ma, Shuming (2024). "The era of 1-bit LLMs: All large language models are in 1.58 bits". <a href="ArXiv_(identifier)" class="mw-redirect" title="ArXiv (identifier)">arXiv</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://arxiv.org/abs/2402.17764">2402.17764</a></span> [<a rel="nofollow" class="external text" href="https://arxiv.org/archive/cs.CL">cs.CL</a>].</cite></span>
</li>
<li id="cite_note-10"><span class="mw-cite-backlink"><b><a href="#cite_ref-10">^</a></b></span> <span class="reference-text"><cite id="CITEREFAndrews2007" class="citation journal cs1">Andrews, George E. (2007). <a rel="nofollow" class="external text" href="https://doi.org/10.1090%2FS0273-0979-07-01180-9">"Euler's "De Partitio numerorum""</a>. <i>Bulletin of the American Mathematical Society</i>. New Series. <b>44</b> (4): <span class="nowrap">561–</span>573. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<span class="id-lock-free" title="Freely accessible"><a rel="nofollow" class="external text" href="https://doi.org/10.1090%2FS0273-0979-07-01180-9">10.1090/S0273-0979-07-01180-9</a></span>. <a href="MR_(identifier)" class="mw-redirect" title="MR (identifier)">MR</a> <a rel="nofollow" class="external text" href="https://mathscinet.ams.org/mathscinet-getitem?mr=2338365">2338365</a>.</cite></span>
</li>
</ol></div></div>
<div class="reflist">
</div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1290876196">
/* start https://en.wikipedia.org/ */
.mw-parser-output .side-box{margin:4px 0;box-sizing:border-box;border:1px solid #aaa;font-size:88%;line-height:1.25em;background-color:var(--background-color-interactive-subtle,#f8f9fa);display:flow-root}.mw-parser-output .infobox .side-box{font-size:100%}.mw-parser-output .side-box-abovebelow,.mw-parser-output .side-box-text{padding:0.25em 0.9em}.mw-parser-output .side-box-image{padding:2px 0 2px 0.9em;text-align:center}.mw-parser-output .side-box-imageright{padding:2px 0.9em 2px 0;text-align:center}@media(min-width:500px){.mw-parser-output .side-box-flex{display:flex;align-items:center}.mw-parser-output .side-box-text{flex:1;min-width:0}}@media(min-width:720px){.mw-parser-output .side-box{width:238px}.mw-parser-output .side-box-right{clear:right;float:right;margin-left:1em}.mw-parser-output .side-box-left{margin-right:1em}}
/* end https://en.wikipedia.org/ */
</style><style data-mw-deduplicate="TemplateStyles:r1237033735">
/* start https://en.wikipedia.org/ */
@media print{body.ns-0 .mw-parser-output .sistersitebox{display:none!important}}@media screen{html.skin-theme-clientpref-night .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .sistersitebox img[src*="Wiktionary-logo-en-v2.svg"]{background-color:white}}
/* end https://en.wikipedia.org/ */
</style><div class="side-box side-box-right sistersitebox"><style data-mw-deduplicate="TemplateStyles:r1126788409">
/* start https://en.wikipedia.org/ */
.mw-parser-output .plainlist ol,.mw-parser-output .plainlist ul{line-height:inherit;list-style:none;margin:0;padding:0}.mw-parser-output .plainlist ol li,.mw-parser-output .plainlist ul li{margin-bottom:0}
/* end https://en.wikipedia.org/ */
</style>
<div class="side-box-flex">
<div class="side-box-image"><span class="noviewer" typeof="mw:File"></span></div>
<div class="side-box-text plainlist">Wikimedia Commons has media related to <span style="font-weight: bold; font-style: italic;"><a href="https://commons.wikimedia.org/wiki/Category:Balanced_ternary" class="extiw external" title="commons:Category:Balanced ternary">Balanced ternary</a></span>.</div></div>
</div>
<ul><li><a rel="nofollow" class="external text" href="http://www.computer-museum.ru/english/setun.htm">Development of ternary computers at Moscow State University</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20090312094241/http://abhijit.info/tristate/tristate.html">Representation of Fractional Numbers in Balanced Ternary</a></li>
<li><a rel="nofollow" class="external text" href="https://www.americanscientist.org/article/third-base">"Third base"</a>, ternary and balanced ternary number systems</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110712221950/http://www.hostsrv.com/webmaa/app1/MSP/webm1010/ternary.msp">The Balanced Ternary Number System</a> (includes decimal integer to balanced ternary converter)</li>
<li><abbr title="On-Line Encyclopedia of Integer Sequences">OEIS</abbr> <a rel="nofollow" class="external text" href="https://oeis.org/A182929">sequence A182929 (The binomial triangle reduced to balanced ternary lists)</a></li>
<li><a rel="nofollow" class="external text" href="http://userpages.wittenberg.edu/bshelburne/BalancedTernaryTalkSu09.pdf">Balanced (Signed) Ternary Notation</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20160303182504/http://userpages.wittenberg.edu/bshelburne/BalancedTernaryTalkSu09.pdf">Archived</a> 2016-03-03 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a> by Brian J. Shelburne (PDF file)</li>
<li><a rel="nofollow" class="external text" href="http://www.mortati.com/glusker/fowler/">The ternary calculating machine of Thomas Fowler</a> by Mark Glusker</li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-07-05" href="https://en.wikipedia.org/wiki/?title=Balanced_ternary&oldid=1298939973">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>
</body></html>